如何从Javascript中的unix时代开始以毫秒为单位获得时间? [英] How to get time in milliseconds since the unix epoch in Javascript?
本文介绍了如何从Javascript中的unix时代开始以毫秒为单位获得时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样才能得到Javascript中的当前纪元
时间?基本上是自1970-01-01午夜以来的毫秒数。
How can I get the current epoch
time in Javascript? Basically the number of milliseconds since midnight, 1970-01-01.
推荐答案
var milliseconds = (new Date).getTime();
这篇关于如何从Javascript中的unix时代开始以毫秒为单位获得时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文