当前位置:网站首页>JS time format conversion
JS time format conversion
2022-04-23 05:20:00 【Lora_ 0925】
// Time shift
time(date, symbol) {
let y = date.getFullYear();
let m = date.getMonth() + 1;
m = m < 10 ? "0" + m : m;
let d = date.getDate();
d = d < 10 ? "0" + d : d;
let h = date.getHours();
h = h < 10 ? "0" + h : h;
let minute = date.getMinutes();
minute = minute < 10 ? "0" + minute : minute;
let second = date.getSeconds();
second = second < 10 ? "0" + second : second;
return y + symbol + m + symbol + d + " " + h + ":" + minute + ":" + second;
}
Use ("/" Division ):
let time=this.time(new Date(), "/");
版权声明
本文为[Lora_ 0925]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220546439733.html
边栏推荐
- Top 25 Devops tools in 2021 (Part 2)
- Restful toolkit of idea plug-in
- Project manager's thinking mode worth trying: project success equation
- What role do tools play in digital transformation?
- Flip coin (Blue Bridge Cup)
- Some experience in using MySQL / tidb database [slowly updating...]
- Basic knowledge of vegetable chicken database
- Nacos source code startup error report solution
- Redis persistence
- Swing display time (click once to display once)
猜你喜欢

The introduction of lean management needs to achieve these nine points in advance

2021-11-01

One month countdown, pgconf What are the highlights of the latest outlook of asia2021 Asian Conference?

Basic theory of Flink

Source code analysis of how to use jump table in redis

2022年最热门的招聘技术技能是什么,您绝对想不到

MySQL circularly adds sequence numbers according to the values of a column

Anti crawler (0): are you still climbing naked with selenium? You're being watched! Crack webdriver anti crawler

To understand Devops, you must read these ten books!

Servlet3 0 + event driven for high performance long polling
随机推荐
WTL self drawn control library (cqscheckcomboxbox)
2021-09-23
Mariadb的半同步复制
Project manager's thinking mode worth trying: project success equation
Redis persistence
node中的redis使用--ioredis
何时适合进行自动化测试?(下)
Grpc long connection keepalive
Three of three JS (webgl) is simple to draw lines / arcs according to points (based on linegeometry / line2 / linematerial, draw two arc segments based on the center of the circle)
Minimum spanning tree -- unblocked project hdu1863
Basic knowledge of vegetable chicken database
Graphics. Fromimage reports an error "graphics object cannot be created from an image that has an indexed pixel..."
Golang memory escape
App Store年交易额100万美元只缴15%佣金,中小开发者心里很矛盾
How does PostgreSQL parse URLs
2021-09-28
学习笔记:Unity CustomSRP-11-Post Processing---Bloom
Routing parameters
WTL 自绘控件库 (CQsCheckComboxBox)
Kubectl command automatic replenishment