Export (0) Print
Expand All

toLocaleTimeString Method (JavaScript)

Returns a time as a string value appropriate to the host environment's current locale.

objDate.toLocaleTimeString( )

The required objDate reference is a Date object.

The toLocaleTimeString method returns a string value that contains a time, in the current time zone, in an easily read format. The time is in the default format of the host environment's current locale. The return value of this method cannot be relied upon in scripting, as it will vary from computer to computer. The toLocaleTimeString method should only be used to format display – never as part of a computation.

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information.

Applies To: Date Object (JavaScript)

Community Additions

© 2015 Microsoft