当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Some experience in using MySQL / tidb database [slowly updating...]
7-4 is it too fat (10 points) PTA
Laravel routing job
Basic theory of Flink
The annual transaction volume of the app store is US $1 million, and only 15% commission is paid. Small and medium-sized developers are very contradictory
Golang memory escape
Streamexecutionenvironment of Flink source code
Master-slave replication of MariaDB database
2021-11-08
2021 年 25 大 DevOps 工具(下)
看板快速启动指南
Traversal of tree
Good test data management, in the end how to do?
Cloud computing and cloud native architecture design of openshift
MySQL foreign key constraint
configmap
d.ts---更详细的知识还是需要看官网的介绍(声明文件章节)
Chapter III project schedule management of information system project manager summary
Modèle axé sur le domaine DDD (III) - gestion des transactions à l'aide de Saga
2021-10-08