Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
ASP.NET Reference
Client Reference
Global Namespace
Date Type Functions
 localeFormat Function

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Date.localeFormat Function

Formats a date by using the current culture. This function is static and can be invoked without creating an instance of the object.

var formattedDate = dateVar.localeFormat(format);
format

A format string.

A string that contains the formatted date value.

Exception type

Condition

Sys.ArgumentException

format was invalid.

Use the localeFormat function to replace the date object value with a text representation based on the format parameter. The localeFormat method provides the date based on a specific culture value (locale). The culture value is also used to display Web information for specific language and country combinations.

To format a date object value by using the localeFormat function, set the EnableScriptGlobalization()()() property of the ScriptManager control to true. You must also modify settings in the Web.config file so that the culture attribute of the <globalization> section is set to auto.

For more information about cultures and locales, see ASP.NET Globalization and Localization and the CultureInfo documentation. For more information about date and time string formats, see Sys.CultureInfo Class.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker