扫码关注官方订阅号
就是输出的时间是遗传数字,怎么才能取到数字中的日呢,不要年月
光阴似箭催人老,日月如移越少年。
如果你的一串数字是时间戳的话直接用Date对象的。
Date
http://jsfiddle.net/Z8ch5/
取日用getDate()
http://www.w3school.com.cn/jsref/jsref_getDate.asp
new Date(1392168480000)
我会告诉你new Date(1392168480).getDate()就可以了吗?^_^
new Date(1392168480).getDate()
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
如果你的一串数字是时间戳的话直接用
Date对象的。http://jsfiddle.net/Z8ch5/
取日用getDate()
http://www.w3school.com.cn/jsref/jsref_getDate.asp
new Date(1392168480000)
我会告诉你
new Date(1392168480).getDate()就可以了吗?^_^