JS怎么把毫秒数转换成年月日时分秒

2024-10-11 21:57:07

1、将时间戳转换成date类型之后var now = new Date(15334蚀卺垦肝72686000);可以通过get僻棍募暖FullYear()的方式获取年份var year = now.getFullYear(); //获取年份

JS怎么把毫秒数转换成年月日时分秒

3、通过getDate()的方式获取日var date = now.getDate(); //获取日期

JS怎么把毫秒数转换成年月日时分秒

5、通过getMinutes()的方式获取分钟var minu = now.getMinutes(); //获取分钟

JS怎么把毫秒数转换成年月日时分秒
猜你喜欢