Convert time to human readable format

112 views
Skip to first unread message

Ashutosh Das

unread,
Nov 15, 2013, 8:50:02 AM11/15/13
to nod...@googlegroups.com
How to convert this time to human readable format

os.uptime()
// -> 1662.184427084

Ben Noordhuis

unread,
Nov 15, 2013, 9:08:21 AM11/15/13
to nod...@googlegroups.com
'' + new Date(Date.now() - os.uptime() * 1000)

(Don't leave out the 'new' keyword. Calling Date() as a function
returns the current time as a string, regardless of the arguments you
pass to it.)

Ashutosh Das

unread,
Nov 15, 2013, 9:57:31 AM11/15/13
to nod...@googlegroups.com
Thanks  :)



--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
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?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/1NYi-PmS3Dk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages