当前位置:网站首页>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>
边栏推荐
猜你喜欢
Talk about my fate with some programming languages
Research and development efficiency improvement practice of large insurance groups with 10000 + code base and 3000 + R & D personnel
haas506 2.0开发教程 - 阿里云ota - pac 固件升级(仅支持2.2以上版本)
Add ICO icon to clion MinGW compiled EXE file
EN 438-7 laminated sheet products for building covering decoration - CE certification
Phpstudy Xiaopi's MySQL Click to start and quickly flash back. It has been solved
Promouvoir le développement de l'industrie culturelle et touristique par la recherche, l'apprentissage et l'enseignement pratique du tourisme
基于vertx-web-sstore-redis的改造实现vertx http应用的分布式session
珍爱网微服务底层框架演进从开源组件封装到自研
ArcGIS\QGIS无插件加载(无偏移)MapBox高清影像图
随机推荐
Use of thread pool
ArcGIS栅格重采样方法介绍
使用WebAssembly在浏览器端操作Excel
MYSQL IFNULL使用功能
大二下个人发展小结
vant 源码解析之 utils/index.ts 工具函数
AITM2-0002 12s或60s垂直燃烧试验
@Validated基础参数校验、分组参数验证和嵌套参数验证
国外LEAD美国简称对照表
显示器要申请BS 476-7 怎么送样?跟显示屏一样吗??
MySQL deep paging optimization with tens of millions of data, and online failure is rejected!
Aitm 2-0003 horizontal combustion test
ClickHouse 复制粘贴多行sql语句报错
Establishment of terminal security capability verification environment and penetration test records
Talk about my fate with some programming languages
WPF gets the control in the datagridtemplatecolumn of the specified row and column in the DataGrid
JS common method encapsulation
Display DIN 4102-1 Class B1 fire test requirements
模式-“里氏替换原则”
Prior knowledge of machine learning in probability theory (Part 1)