Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
All Objects
Date Object
METHOD: Date::toLocaleString
object.
toLocaleString( )
This method uses the relevant locale's date conventions when converting a date to a string. This is done by using the default date format of the user's operating system. This takes in to account the differences between date formatting methods used in different countries, e.g. in the U.K. the date comes before the month as opposed to the U.S. convention of the month first.
The following code uses the
toLocaleString
method to convert the date set in the myDate object to a string. For the purposes of this example, the locale of the operating system is set to that of the United Kingdom.
Code:
myDate = new Date(99, 04, 23)
document.write(myDate.toLocaleString())
Output:
23/05/1999 00:00:00
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information