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);
A format string.
A string that contains the formatted date value.
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.