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