当前位置:网站首页>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>
边栏推荐
- Is Kai Niu 2980 useful? Is it safe to open an account
- ViewRootImpl和WindowManagerService笔记
- Material Design组件 - 使用BottomSheet展现扩展内容(二)
- Popular science | does poor English affect the NPDP exam?
- 从架构上详解技术(SLB,Redis,Mysql,Kafka,Clickhouse)的各类热点问题
- Wood board ISO 5660-1 heat release rate mapping test
- 第05章_存储引擎
- leetcode:1139. The largest square bounded by 1
- Dictionary tree simple introductory question (actually blue question?)
- 10000+ 代码库、3000+ 研发人员大型保险集团的研发效能提升实践
猜你喜欢
PHP deserialization +md5 collision
请查收.NET MAUI 的最新学习资源
Arcgis\qgis no plug-in loading (no offset) mapbox HD image map
leetcode:1139. 最大的以 1 为边界的正方形
教你自己训练的pytorch模型转caffe(三)
Analyze the knowledge transfer and sharing spirit of maker Education
CLion配置visual studio(msvc)和JOM多核编译
基于flask写一个接口
EN 438-7 laminated sheet products for building covering decoration - CE certification
Maker education infiltrating the transformation of maker spirit and culture
随机推荐
概率论机器学习的先验知识(上)
从架构上详解技术(SLB,Redis,Mysql,Kafka,Clickhouse)的各类热点问题
hdu2377Bus Pass(构建更复杂的图+spfa)
AITM 2-0003 水平燃烧试验
Using webassembly to operate excel on the browser side
phpstudy小皮的mysql点击启动后迅速闪退,已解决
@Validated基础参数校验、分组参数验证和嵌套参数验证
Wood board ISO 5660-1 heat release rate mapping test
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(二)
ArcGIS\QGIS无插件加载(无偏移)MapBox高清影像图
EN 438-7 laminated sheet products for building covering decoration - CE certification
Display DIN 4102-1 Class B1 fire test requirements
Enclosed please find. Net Maui's latest learning resources
Simple getting started example of Web Service
MySQL deep paging optimization with tens of millions of data, and online failure is rejected!
股票开户选择哪家证券公司比较好哪家平台更安全
leetcode:1755. 最接近目标值的子序列和
When steam education enters personalized information technology courses
Maker education infiltrating the transformation of maker spirit and culture