码迷,mamicode.com
首页 > Web开发 > 详细

js 获取昨天,今天和明天的年月日格式

时间:2017-09-21 21:16:19      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:年月日   col   get   gettime   color   code   new   bsp   style   

 1 //昨天:
 2 const yestoday =  new Date().getTime() - 24*60*60*1000;
 3 
 4 //今天:
 5 const today = new Date();
 6 
 7 //明天:
 8 const tomorrow = new Date().getTime() + 24*60*60*1000;
 9 
10 //最终的格式 如:2017-09-21

 

js 获取昨天,今天和明天的年月日格式

标签:年月日   col   get   gettime   color   code   new   bsp   style   

原文地址:http://www.cnblogs.com/yeanet/p/7570168.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!