Trivial facts about Javascript date

Fact 1:

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);


I'm a keen traveller to see every country in the world, passionate about cutting edge technologies.


Leave a reply

Your email address will not be published. Required fields are marked *