js 获取昨日00:00:00和23:59:59的时间戳
2023-12-14 10:53:01
getDayBeforeYesterdayTimestamps () {
const now = new Date()
const dayBeforeYesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000)
const dayBeforeYesterdayTimestamp = dayBeforeYesterday.getTime()
const dayBeforeYesterdayStartOfDay = new Date(dayBeforeYesterdayTimestamp).setHours(0, 0, 0, 0)
const dayBeforeYesterdayEndOfDay = new Date(dayBeforeYesterdayTimestamp).setHours(23, 59, 59, 999)
console.log(dayBeforeYesterdayStartOfDay, dayBeforeYesterdayEndOfDay)
}
}
文章来源:https://blog.csdn.net/weixin_43563864/article/details/134988441
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!