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.parseLocale Function

Creates a date from a locale-specific string by using the current culture. This function is static and can be invoked without creating an instance of the object.


var a = Date.parseLocale(value, formats);



A locale-specific string that represents a date.


(Optional) An array of custom formats.

Return Value

If value is a valid string representation of a date, an object of type Date; otherwise, null.


Exception Type Condition


(Debug) formats contains an invalid format.


Use the pareseLocale function to create an object of type Date from a string. If you provide no custom formats, this function uses the Sys.CultureInfo.CurrentCulture property to determine the culture value.

To create a date from a locale-specific string that uses the current culture, 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.