当前位置:网站首页>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>
边栏推荐
- Display DIN 4102-1 Class B1 fire test requirements
- PVC plastic sheets BS 476-6 determination of flame propagation properties
- Use of thread pool
- 珍爱网微服务底层框架演进从开源组件封装到自研
- 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
- AITM2-0002 12s或60s垂直燃烧试验
- 中国的软件公司为什么做不出产品?00后抛弃互联网;B站开源的高性能API网关组件|码农周刊VIP会员专属邮件周报 Vol.097
- Comparison table of foreign lead American abbreviations
- LeetCode_ Hash table_ Difficulties_ 149. Maximum number of points on the line
- Vant source code parsing event Detailed explanation of TS event processing global function addeventlistener
猜你喜欢

leetcode:1139. The largest square bounded by 1

Cutting edge technology for cultivating robot education creativity

珍爱网微服务底层框架演进从开源组件封装到自研

PHP deserialization +md5 collision

PVC 塑料片BS 476-6 火焰传播性能测定

haas506 2.0开发教程 - 阿里云ota - pac 固件升级(仅支持2.2以上版本)

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

R语言【数据管理】

LeetCode_ Hash table_ Difficulties_ 149. Maximum number of points on the line
![[case] Application of positioning - Taobao rotation map](/img/2d/c834ce95a2c8e53a20e67fa2e99439.png)
[case] Application of positioning - Taobao rotation map
随机推荐
MySQL 千万数据量深分页优化, 拒绝线上故障!
Sophomore personal development summary
ODPs next map / reduce preparation
Monorepo管理方法论和依赖安全
Is it necessary for bazel to learn
POJ 3414 pots (bfs+ clues)
Five layer network protocol
ViewRootImpl和WindowManagerService笔记
js常用方法封装
Duchefa cytokinin dihydrozeatin (DHZ) instructions
Determine the best implementation of horizontal and vertical screens
Sequence alignment
SQL series (basic) - Chapter 2 limiting and sorting data
Hdu2377bus pass (build more complex diagram +spfa)
phpstudy小皮的mysql点击启动后迅速闪退,已解决
vant 源码解析 event.ts 事件处理 全局函数 addEventListener详解
基于vertx-web-sstore-redis的改造实现vertx http应用的分布式session
sql系列(基础)-第二章 限制和排序数据
学习机器人无从下手?带你体会当下机器人热门研究方向有哪些
Material Design组件 - 使用BottomSheet展现扩展内容(二)