当前位置:网站首页>获取前一天的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>
边栏推荐
- ProSci LAG3抗体的化学性质和应用说明
- 中国的软件公司为什么做不出产品?00后抛弃互联网;B站开源的高性能API网关组件|码农周刊VIP会员专属邮件周报 Vol.097
- Composition of applet code
- Applet global configuration
- 小程序项目结构
- AI 从代码中自动生成注释文档
- Abnova丨CRISPR SpCas9 多克隆抗体方案
- Introduction to dead letter queue (two consumers, one producer)
- 清除app data以及获取图标
- CVPR 2022 | common 3D damage and data enhancement
猜你喜欢

MySQL InnoDB架构原理

培养机器人教育创造力的前沿科技

1. Strengthen learning basic knowledge points

2.8 basic knowledge of project management process

IC popular science article: those things about Eco

Chemical properties and application instructions of prosci Lag3 antibody

Duchefa low melting point agarose PPC Chinese and English instructions

ProSci LAG3抗体的化学性质和应用说明

Abnova total RNA Purification Kit for cultured cells Chinese and English instructions

How to make ERP inventory accounts of chemical enterprises more accurate
随机推荐
Schema and model
19 mongoose modularization
E. Singhal and numbers (prime factor decomposition)
1. Strengthen learning basic knowledge points
产品好不好,谁说了算?Sonar提出分析的性能指标,帮助您轻松判断产品性能及表现
Abnova fluorescent dye 620-m streptavidin scheme
Make Jar, Not War
Abnova cyclosporin a monoclonal antibody and its research tools
鸿蒙系统控制LED的实现方法之经典
Abnova CRISPR spcas9 polyclonal antibody protocol
3.3 project evaluation
【UE4】UnrealInsight获取真机性能测试报告
NPDP如何续证?操作指南来了!
3.3、项目评估
PHP反序列化+MD5碰撞
Duchefa MS medium contains vitamin instructions
教你自己训练的pytorch模型转caffe(一)
2020 CCPC Weihai - A. golden spirit (thinking), D. ABC project (big number decomposition / thinking)
Duchefa丨D5124 MD5A 培养基中英文说明书
Abbkine BCA法 蛋白质定量试剂盒说明书