Getting unix time stamp version of mtime of a file

450 views
Skip to first unread message

RobKohr

unread,
Nov 27, 2010, 1:09:54 PM11/27/10
to nodejs
fs.stat returns
{
...
, mtime: '2009-06-29T11:11:40Z'
}

I would like to get the modification time in seconds from the epoc. Is
there any way to get that (perhaps through a simple conversion?)

Thanks,
Rob

Nathan Rajlich

unread,
Nov 27, 2010, 3:03:23 PM11/27/10
to nod...@googlegroups.com
Isn't the `mtime` property a regular Date instance? In that case you should be able to call `mtime.getTime()` to get the value you need!


--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.


Reply all
Reply to author
Forward
0 new messages