Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

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.

Syntax

var formattedDate = dateVar.localeFormat(format);

Arguments

format

A format string.

Return Value

A string that contains the formatted date value.

Exceptions

Exception Type Condition

ArgumentException

format was invalid.

Remarks

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 Standard DateTime Format Strings and Standard DateTime Format Strings Output Examples.