December 2013
Intermediate to advanced
384 pages
9h 54m
English
var d = new Date("Sat Jan 04 2014 15:03:22 GMT-0700"); d.getDate(); //returns 4 d.getDay(); //returns 6 d.getFullYear(); //returns 2014 d.getHours(); //returns 15 d.getMinutes(); //returns 3 d.getMinutes(); //returns 22 d.getTime(); //returns 1388873002000 d.getTimeZoneOffset(); //returns 420
The Date object provides several methods to get the value of specific components of the date, such as year, day of month, day of week, and more. Table 2.5 lists the methods to get specific date components from the Date object.
Table 2.5 Date Object Methods to Get Specific Date Components
Read now
Unlock full access