| d |
Outputs the day as a number without a leading zero (1-31).
|
| dd |
Outputs the day as a number with a leading zero (01-31).
|
| ddd |
Outputs the day as an abbreviation (Sun-Sat).
The names are determined by the web server settings for the LOCALE_SABBREVDAYNAME locale entries.
|
| dddd |
Outputs the day as a full name (Sunday-Saturday).
The names are determined by the web server settings for the LOCALE_SDAYNAME locale entries.
|
| ddddd |
Outputs the date using the system short-date format.
The format is determined by the web server settings for the LOCALE_SSHORTDATE locale entries.
|
| dddddd |
Outputs the date using the system long-date format.
The format is determined by the web server settings for the LOCALE_SLONGDATE locale entries.
|
| m |
Outputs the month as a number without a leading zero (1-12).
|
| mm |
Outputs the month as a number with a leading zero (01-12).
|
| mmm |
Outputs the month as an abbreviation (Jan-Dec).
The names are determined by the web server settings for the LOCALE_SABBREVMONTHNAME locale entries.
|
| mmmm |
Outputs the month as a full name (January-December).
The names are determined by the web server settings for the LOCALE_SMONTHNAME locale entries.
|
| yy |
Outputs the year as a two-digit number (00-99).
|
| yyyy |
Outputs the year as a four-digit number (0000-9999).
|
"% [- [width]] [.prec] type"
|
| % |
REQUIRED percent sign. |
| - |
Optional hyphen signifying left justification. If the hyphen is specified along
with the width, the numeric output value will be left justified is the output
area. Right justification is the default.
|
| [width] |
Optional value WIDTH. If the formatted value is shorter than the width, it is
passed with spaces. If the value is larger, the width is increased so that no
digits are left out.
|
| [.prec] |
Optional value PRECISION. This determines the number of digits to the right
of the decimal. The default is two.
|
| type |
REQUIRED value TYPE. The following types are supported:
e Scientific notation.
f Fixed point decimal.
g General. Result is e or f, whichever is shorter.
n Number. Same as f, except thousand separators are included.
m Money. Not applicable to these conversions.
|
| FORMAT Examples |
| %.2f |
Value is output with two digits to the right of the decimal
and no extra padding blanks. This is the default format. If
you don't specify the FORMAT attribute at all, this is what
you'll get.
|
| %10.1n |
Value is output with one digit to the right of the decimal.
The integer part of the value will include thousand separators.
If needed, the value is padded with blanks (on the left) to
make it 10 characters long.
|
| %-10.1n |
Same as the previous example, except the value is left-justified
within the 10 character length, i.e. padding blanks are added
to the right of the value.
|
| %.6e |
Value is output using scientific notation, with no more than
six digits to the right of the decimal.
|
| FORMAT="%.2f meters" |
| FORMAT="%.0f degrees Celsius" |
| FORMAT="Have a nice day. Oh, by the way, the answer is: %.3 feet." |