当前位置:网站首页>获取前一天的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>
边栏推荐
- Classic implementation method of Hongmeng system controlling LED
- Abnova丨荧光染料 620-M 链霉亲和素方案
- Is the securities account given by the school of Finance and business safe? Can I open an account?
- Mongodb basic exercises
- Leetcode (347) - top k high frequency elements
- ProSci LAG3抗体的化学性质和应用说明
- Duchefa丨MS培养基含维生素说明书
- Informatics Orsay all in one 1339: [example 3-4] find the post order traversal | Valley p1827 [usaco3.4] American Heritage
- Use of thread pool
- Propping of resources
猜你喜欢
![Ros2 topic [01]: installing ros2 on win10](/img/46/550945aa36d2bec03e5dd29404f409.png)
Ros2 topic [01]: installing ros2 on win10

National Eye Care Education Conference, 2022 the Fourth Beijing International Youth eye health industry exhibition

Duchefa细胞分裂素丨二氢玉米素 (DHZ)说明书

PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug

MySQL InnoDB架构原理

教你自己训练的pytorch模型转caffe(一)

Abnova fluorescent dye 620-m streptavidin scheme

CVPR 2022 | 常见3D损坏和数据增强

IC popular science article: those things about Eco

Kubernetes resource object introduction and common commands (V) - (configmap & Secret)
随机推荐
Abnova DNA marker high quality control test program
Duchefa cytokinin dihydrozeatin (DHZ) instructions
2020 CCPC Weihai - A. golden spirit (thinking), D. ABC project (big number decomposition / thinking)
Informatics Olympiad 1340: [example 3-5] extended binary tree
Point cloud file Dat file read save
IC popular science article: those things about Eco
Informatics Olympiad 1337: [example 3-2] word search tree | Luogu p5755 [noi2000] word search tree
1、强化学习基础知识点
mysql全面解析json/数组
Duchefa s0188 Chinese and English instructions of spectinomycin hydrochloride pentahydrate
重上吹麻滩——段芝堂创始人翟立冬游记
2.<tag-哈希表, 字符串>补充: 剑指 Offer 50. 第一个只出现一次的字符 dbc
14、Transformer--VIT TNT BETR
Where is a good stock account? Is online account manager safe to open an account
Dry goods navigation in this quarter | Q2 2022
Implementation of redis unique ID generator
Duchefa细胞分裂素丨二氢玉米素 (DHZ)说明书
CVPR 2022 | common 3D damage and data enhancement
Applet global configuration
基于AVFoundation实现视频录制的两种方式