Expand Minimize
1 out of 2 rated this helpful - Rate this topic

toTimeString Method (Date) (JavaScript)

JavaScript - Internet Explorer 10

Returns a time as a string value.

objDate. toTimeString( )

The required objDate reference is a Date object.

The toTimeString method returns a string value containing the time in the current time zone.

In the following example, the time is set to 2000 milliseconds after midnight January 1, 1970 UTC, and then it is written out.

var aDate = new Date();
     aDate.setTime(2000);
     document.write(aDate.toTimeString());

// Output depends on the time in the current time zone.

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards. Also supported in Windows Store apps. See Version Information.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.