码迷,mamicode.com
首页 > 其他好文 > 详细

tomorrow - 明天

时间:2018-01-18 18:01:58      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:fun   token   style   div   获取   tom   func   variable   date()   

以字符串形式返回明天日期表示。

使用 new Date() 获取今天的日期,加上 86400000 秒(24小时),使用 Date.toISOString() 将 Date 对象转换为字符串。

const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split(‘T‘)[0];

tomorrow(); // 2017-12-27 (if current date is 2017-12-26)

tomorrow - 明天

标签:fun   token   style   div   获取   tom   func   variable   date()   

原文地址:https://www.cnblogs.com/bali123/p/8311456.html

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