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
 format Function
Date.format Function

Updated: November 2007

Formats a date by using the invariant (culture-independent) culture.

var a = dateVar.format(format);
format

A format string.

A string that contains the formatted date value.

Exception type

Condition

Sys.ArgumentException

format is invalid.

Use the format method to replace the date object value with a text representation based on the format parameter. The format method formats a date using the invariant (culture-independent) culture. The invariant culture is culture-insensitive.

Use the format method when the formatted value depends on a string comparison or a case-change operation. This makes sure that the behavior is consistent regardless of the culture settings of the system.

The invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, the method can produce results that might be linguistically incorrect or culturally inappropriate.

The format method is not affected by the EnableScriptGlobalization attribute of the ScriptManager class.

For more information about date and time string formats, see Sys.CultureInfo Class.

Reference

Other Resources

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker