一般这样创建一个日期变量 var d = new Date("2017-08-11 12:00:00"); 发现在iOS中不兼容,返回valid Date. IOS中不支持 - 连接日期 function strToDate(dateObj){ dateObj = dateObj.replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '').replace(/(-)/g, '/') if (dateObj.indexOf(".")>…
1.读取日期 Linux:~ # date Mon Dec 17 03:16:53 EST 2018 2.格式日期并打印 Linux:~ # date "+%d %B %Y" 17 December 2018 3.设置日期时间 Linux:~ # date -s "16 Dec 2018 5:20:21" Sun Dec 16 05:20:21 EST 2018 上述命令为设置系统日期为:2018年12月16日 5点20分21秒 4.查看命令运行时间 #!/bin/…