2013-08-02 40 views
0

所以,我知道你可以做這樣的事情:的NodeJS得到一時間以毫秒爲單位

prev.mtime 

fs.watchFile功能的一面,但將返回的東西格式化這樣的日期:

Fri Aug 02 2013 17:40:28 GMT-0400 (EDT) 

但我想以毫秒爲單位獲取以前的時間戳行。

+0

+ new Date(prev.mtime) – dandavis

回答

-6

哇,沒關係......我知道了:

console.dir(prev.mtime.getTime()); 
console.dir(curr.mtime.getTime()); 

這很容易!

+0

這就是我3小時前給你的答案,當你問。 –

+1

你應該接受丹的回答。他回答正確,並就你的問題和答案給出了一些解釋。 – randunel

相關問題