时间格式处理

获取中国标准时间    new Date()   

Fri Oct 11 2019 15:09:32 GMT+0800 (中国标准时间)

中国标准时间转换成(年月日时分秒)new Date().toLocaleString()

"2019/10/11 下午3:11:02"

中国标准时间转换成(年月日)new Date().toLocaleDateString()

"2019/10/11"

中国标准时间转换成(毫秒)new Date().getTime()

1570778033279

毫秒转换成中国标准时间  new Date(1570778033279)

Fri Oct 11 2019 15:13:53 GMT+0800 (中国标准时间)

猜你喜欢

转载自www.cnblogs.com/fromIceWorld/p/12162693.html