当前位置:网站首页>Get JS of the previous day (timestamp conversion)
Get JS of the previous day (timestamp conversion)
2022-07-05 21:05:00 【kilito_ 01】
<script type="text/javascript">
// Get the current timestamp
var timestamp = (new Date()).getTime();
// Timestamp of the time of day
var onday = 1000*60*60*24
// The time stamp of a day's time money
var beforeTime = timestamp - onday
function getTime(times){
var time = new Date(times);
var y = time.getFullYear();
var m = time.getMonth()+1 ;
var d = time.getDate();
m = m>=0 && m<=9 ? '0'+m : m
d = d>=0 && d<=9 ? '0'+d : d
return y+'-'+m+'-'+d;
}
var t = getTime(beforeTime)
console.log(t);
</script>
边栏推荐
- haas506 2.0开发教程 - 阿里云ota - pac 固件升级(仅支持2.2以上版本)
- Mode - "Richter replacement principle"
- How to renew NPDP? Here comes the operation guide!
- 判断横竖屏的最佳实现
- Clion configures Visual Studio (MSVC) and JOM multi-core compilation
- PHP deserialization +md5 collision
- Dictionary tree simple introductory question (actually blue question?)
- 最长摆动序列[贪心练习]
- 大二下个人发展小结
- Arcgis\qgis no plug-in loading (no offset) mapbox HD image map
猜你喜欢
Write an interface based on flask
PVC plastic sheets BS 476-6 determination of flame propagation properties
XML建模
基于flask写一个接口
Using webassembly to operate excel on the browser side
最长摆动序列[贪心练习]
leetcode:1755. 最接近目标值的子序列和
phpstudy小皮的mysql点击启动后迅速闪退,已解决
Who the final say whether the product is good or not? Sonar puts forward performance indicators for analysis to help you easily judge product performance and performance
教你自己训练的pytorch模型转caffe(一)
随机推荐
启牛2980有没有用?开户安全吗、
Maker education infiltrating the transformation of maker spirit and culture
R language [data management]
Add ICO icon to clion MinGW compiled EXE file
LeetCode_哈希表_困难_149. 直线上最多的点数
Arcgis\qgis no plug-in loading (no offset) mapbox HD image map
模式-“里氏替换原则”
[case] Application of element display and hiding -- element mask
示波器探头对信号源阻抗的影响
Open source SPL eliminates tens of thousands of database intermediate tables
Enclosed please find. Net Maui's latest learning resources
sql系列(基础)-第二章 限制和排序数据
MYSQL IFNULL使用功能
phpstudy小皮的mysql点击启动后迅速闪退,已解决
@Validated基础参数校验、分组参数验证和嵌套参数验证
Implementation of redis unique ID generator
The development of research tourism practical education helps the development of cultural tourism industry
PVC 塑料片BS 476-6 火焰传播性能测定
LeetCode: Distinct Subsequences [115]
js常用方法封装