Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用的软件会记录歌曲在数据库中播放的时间,时间戳格式如2011-04-13 17:55:46. 它还以毫秒为单位记录歌曲的长度。如何将该时间戳转换为毫秒?其次,如何计算剩余时间,以便在时间到时使用它来刷新页面?
2011-04-13 17:55:46
var date = new Date("2011-04-13 17:55:46"); var milliseconds = date.getTime(); alert (milliseconds);
1302697546000
如何在javascript中计算日期差异
在javascript中获取2个日期之间的差异?