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
 parseLocale 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.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);
value

A locale-specific string that represents a date.

formats

(Optional) An array of custom formats.

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

Exception type

Condition

Sys.ArgumentException

(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.

Reference

Other Resources

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