js常用时间转换

dateUtile.js 代码
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

const timeToEng = function(time) {
const date = new Date(time)
return months[date.getMonth()]
}
// 输入time为时间戳,add表示加减天数, 默认为0
const timeFormat = function(time, fmt, add=0) {
if (time === undefined || time === null) {
return '无'
}
var date = new Date()
date.setTime(new Date(Numb

js常用时间转换最先出现在Python成神之路

版权声明:
作者:ht
链接:https://www.techfm.club/p/20500.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>