当前位置:网站首页>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>
边栏推荐
- ODPS 下一个map / reduce 准备
- 研学旅游实践教育的开展助力文旅产业发展
- CLion配置visual studio(msvc)和JOM多核编译
- 请查收.NET MAUI 的最新学习资源
- Interpreting the daily application functions of cooperative robots
- SQL series (basic) - Chapter 2 limiting and sorting data
- PHP deserialization +md5 collision
- wpf 获取datagrid 中指定行列的DataGridTemplateColumn中的控件
- ClickHouse 复制粘贴多行sql语句报错
- 字典树简单入门题(居然是蓝题?)
猜你喜欢

EN 438-7 laminated sheet products for building covering decoration - CE certification

ArcGIS\QGIS无插件加载(无偏移)MapBox高清影像图

使用WebAssembly在浏览器端操作Excel

leetcode:1139. The largest square bounded by 1

从架构上详解技术(SLB,Redis,Mysql,Kafka,Clickhouse)的各类热点问题

Écrire une interface basée sur flask
![最长摆动序列[贪心练习]](/img/e1/70dc21b924232c7e5e3da023a4bed2.png)
最长摆动序列[贪心练习]

浅聊我和一些编程语言的缘分

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

ArcGIS栅格重采样方法介绍
随机推荐
ODPs next map / reduce preparation
Analyze the knowledge transfer and sharing spirit of maker Education
ArcGIS栅格重采样方法介绍
[case] Application of positioning - Taobao rotation map
The development of research tourism practical education helps the development of cultural tourism industry
LeetCode: Distinct Subsequences [115]
Talk about my fate with some programming languages
基于vertx-web-sstore-redis的改造实现vertx http应用的分布式session
XML建模
Material Design组件 - 使用BottomSheet展现扩展内容(二)
Mode - "Richter replacement principle"
2.<tag-哈希表, 字符串>补充: 剑指 Offer 50. 第一个只出现一次的字符 dbc
ts 之 类的简介、构造函数和它的this、继承、抽象类、接口
WPF gets the control in the datagridtemplatecolumn of the specified row and column in the DataGrid
How to make ERP inventory accounts of chemical enterprises more accurate
Influence of oscilloscope probe on signal source impedance
五层网络协议
Comparison table of foreign lead American abbreviations
MySQL ifnull usage function
LeetCode_ Hash table_ Difficulties_ 149. Maximum number of points on the line