js获取当前时间的年月日时分秒以及时间的格式化 1.获取当前时间 var myDate = new Date(); 2.获取时间中的年月日时分秒 myDate.getYear(); // 获取当前年份(2位) myDate.getFullYear(); // 获取完整的年份(4位,1970 更多内容请查看https://www.cnblogs.com/gwkzb/p/12603005.html
SegmentFault 思否JS 时间戳转换、获取当前时间年月日、自定义返回格式2021年9月15日 · //获取当前的年月日. let date_ = new Date(); let seperator1 = "-"; let year = date_.getFullYear(); let month = date_.getMonth() + 1; let strDate = date_.getDate(); 更多内容请查看https://segmentfault.com/a/1190000040688140