标签:Date对象

共 1 篇
学习笔记

JS时间对象操作以及时间格式化

JS时间对象取当前时间1var nowTime = new Date(); 取年、月、日123nowTime.getFullYear(); // 年nowTime.getMonth() + 1; // 月 因为 getMonth 返回的是从(0-11)的月份,故需+1nowTime.getDate(); // 日 其他方法 getgetTime():返回从 1970 年 1 月 1 日至今的毫秒数...