Format
Overview
Formats the value according to the string you specify.Syntax
Format(1, 2, 3, 4)
| Ordinal | Type | Description | |
|---|---|---|---|
| 1 | string | Required | Variable to format |
| 2 | string | Required | A C# compatible format string:
|
| 3 | string | Indicates data format of value. Valid values include Date and Number. | |
| 4 | string | Culture code used to indicate the correct date format. |
Usage
There are multiple possibilities for displaying the date using this function.
For more information on formatting numeric strings, see the Microsoft help regarding the NumberFormatInfoClass.
Example 1
%%=Format(Now(),"MM/dd/yyyy")=%%
System returns today's date in MM/dd/yyyy format.
Example 2
%%=Format(@currency_variable,"$#,#.00;-$#,#.00")=%%
Example 3
%%=Format('2009-06-15T13:45:30', 'dddd dd MMMM h:mm', 'Date', 'fr-FR')=%%
System returns the formatted date localized for fr-FR.
lundi 15 juin 1:45