Поделиться через


Date.parseInvariant Function

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

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

Arguments

  • value
    A string that represents a date.

  • formats
    (Optional) An array of custom formats.

Return Value

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

Exceptions

Exception type

Condition

Sys.ArgumentException

(Debug) formats contains an invalid format.

Remarks

Use the parseInvariant function to create an object of type Date from a string. The EnableScriptGlobalization property of the ScriptManager control has no effect on this function.

See Also

Reference

Date Type Extensions

Other Resources

Language Reference