Dates & Times


The Date is infact an interface not a data type


Date objects use an integer value that is the number of milliseconds since 1 January 1970 UTC.


var date1 = new Date("January 5, 2019 02:36:00") 
console.log(date1)

Dates are declared using the Date constructor
This is an object
The month parameter is zero based

var myDate = new Date(2020,11,01);   //this is December 
var myDate = new Date("1 July 2020");
var myTodaysDate = new Date();

var myDate = new Date(); 
var myHour = myDate.getHours();

Methods

toUTCString
getHours


Datejs library

datejs.com











© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopNext