toLocaleTimeString()
Date
instance method getterS2C Home
« Globals « Date « toLocaleTimeString()
Description
Returns a locale specific string of the time portion of the specified date.
Syntax
Signature | Description |
---|---|
aDate.toLocaleTimeString() | Returns a locale specific string of the time portion of the specified date. |
Parameters
None.
Examples
The code below shows an example of the toLocaleTimeString()
method of Date
.
// Create a Date instance for the current date and time.
var todaysDate = new Date();
alert(todaysDate);
alert(todaysDate.toLocaleTimeString() +
' = Locale Time portion of a Date object');
Related Tutorials
JavaScript Intermediate Tutorials - Lesson 2 - Dates and Times