Victor Leung
Victor Leung
BlogFlower shop

Trivial facts about Javascript date

April 29, 2016

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

About Victor Leung

Software development professional with expertise in application architecture, cloud solutions deployment, and financial products development. Possess a Master's degree in Computer Science and an MBA in Finance. Highly skilled in AWS (Certified Solutions Architect Professional, Developer and SysOps Administrator), GCP (Professional Cloud Architect), Microsoft Azure, Kubernetes(CKA, CKAD, CKS, KCNA), and Scrum(PSM, PSPO) methodologies.

Happy to connect

Continuous improvement

Copyright © 2023.