December 2013
Intermediate to advanced
384 pages
9h 54m
English
var d = new Date(); d.toLocaleTimeString() 1:55:13 PM d.toTimeString() 13:55:13 GMT-0600 (Mountain Daylight Time)
The Date object also allows you to get just a time string. There are two methods attached to the Date object that return a time string. The .toTimeString() method returns a time string with the time, time zone, and even daylight savings time information. The .toLocaleTimeString() returns a more basic time string with local formatted time.
Read now
Unlock full access