Date to Integer
Date as String Value:
new Date()
// Date {Fri Nov 23 2012 21:51:02 GMT+0100 (CET)}
Date as Integer Value
+new Date()
// 1353703862519Written by Béla Varga
Related protips
1 Response
Thanks! Might be fair to mention that the value is in milliseconds since epoch, unlike the seconds you might be used to.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Related Tags
#javascript
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#