Trivial facts about Javascript date

April 29, 2016

Integer value representing the month, beginning with 0 for January to 11 for December. For example,

Today is

var date = new Date(2016, 3, 29, 11, 10, 30)

instead of

var date = new Date(2016, 4, 29, 11, 10, 30)

Fact 2:

The JavaScript date is based on a time value that is milliseconds, while UNIX timestamp is in second since 00:00:00 UTC on January 1, 1970.

For example, to convert a Unix time:

var date = new Date(UNIX_Timestamp * 1000);


Written by Victor Leung who is a keen traveller to see every country in the world, passionate about cutting edge technologies. Follow me on Twitter