当前位置:网站首页>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
边栏推荐
- 学习笔记:Unity CustomSRP-10-Point and Spot Shadows
- Study notes: unity customsrp-11-post processing --- bloom
- egg测试的知识大全--mock、superTest、coffee
- MFC实现资源单独Dll实现
- My old programmer's perception of the dangers and opportunities of the times?
- 如何在Word中添加漂亮的代码块 | 很全的方法整理和比较
- Good test data management, in the end how to do?
- Data management of basic operation of mairadb database
- 学习笔记:Unity CustomSRP-13-ColorGrading
- Three of three JS (webgl) simple sorting of rotation attribute function, and a simple case of rotating around the axis based on this
猜你喜欢
Using PHP post temporary file mechanism to upload arbitrary files
如何在Word中添加漂亮的代码块 | 很全的方法整理和比较
Redis persistence
Flip coin (Blue Bridge Cup)
phphphphphphphp
Let the LAN group use the remote device
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)
Publish your own wheel - pypi packaging upload practice
2021-11-01
低代码和无代码的注意事项
随机推荐
Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
JSP-----JSP简介
Three 之 three.js (webgl)简单实现根据点绘制线/弧线(基于LineGeometry / Line2 / LineMaterial,绘制两点基于圆心的弧线段)
Master-slave replication of MariaDB database
改进DevSecOps框架的 5 大关键技术
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
低代码和无代码的注意事项
Installing kuberneters using kubedm
MFC implementation resources are implemented separately by DLL
d.ts---更详细的知识还是需要看官网的介绍(声明文件章节)
Three 之 three.js (webgl)旋转属性函数的简单整理,以及基于此实现绕轴旋转的简单案例
4 most common automated test challenges and Countermeasures
egg中的多进程模型--egg文档搬运工
WTL self drawn control library (cqscheckcomboxbox)
Open source rule engine - Ice: dedicated to solving flexible and complex hard coding problems
MFC实现资源单独Dll实现
2021-09-23
学习笔记:Unity CustomSRP-10-Point and Spot Shadows
即将毕业的大学生找技术开发工作的焦虑根源
学习笔记:Unity CustomSRP-12-HDR