var d = new Date(); d.toLocaleTimeString() 1:55:13 PM d.toTimeString() 13:55:13 GMT-0600 (Mountain Daylight Time)
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.