当前位置:网站首页>获取前一天的js(时间戳转换)
获取前一天的js(时间戳转换)
2022-07-05 20:42:00 【kilito_01】
<script type="text/javascript">
// 获取现在的时间戳
var timestamp = (new Date()).getTime();
// 一天时间的时间戳
var onday = 1000*60*60*24
// 一天时间钱的时间戳
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>
边栏推荐
- How to form standard interface documents
- 2020 CCPC Weihai - A. golden spirit (thinking), D. ABC project (big number decomposition / thinking)
- How to renew NPDP? Here comes the operation guide!
- Abbkine丨TraKine F-actin染色试剂盒(绿色荧光)方案
- phpstudy小皮的mysql点击启动后迅速闪退,已解决
- 2022北京眼睛健康用品展,护眼产品展,中国眼博会11月举办
- Relationship between mongodb documents
- Document method
- 小程序事件绑定
- 3.3、项目评估
猜你喜欢
随机推荐
产品好不好,谁说了算?Sonar提出分析的性能指标,帮助您轻松判断产品性能及表现
Is the securities account given by the school of Finance and business safe? Can I open an account?
Classic implementation method of Hongmeng system controlling LED
Relationship between mongodb documents
资源道具化
【愚公系列】2022年7月 Go教学课程 004-Go代码注释
NPDP如何续证?操作指南来了!
National Eye Care Education Conference, 2022 the Fourth Beijing International Youth eye health industry exhibition
表单文本框的使用(二) 输入过滤(合成事件)
CADD course learning (7) -- Simulation of target and small molecule interaction (semi flexible docking autodock)
Abnova丨培养细胞总 RNA 纯化试剂盒中英文说明书
CVPR 2022 | common 3D damage and data enhancement
鸿蒙系统控制LED的实现方法之经典
E. Singhal and numbers (prime factor decomposition)
Ros2 topic [01]: installing ros2 on win10
Material Design组件 - 使用BottomSheet展现扩展内容(二)
Go file path operation
Interpreting the daily application functions of cooperative robots
小程序全局配置
Selenium element information









