Time display formats
Time display formats can have two sections. The first is
required and contains the format for times; the second is optional and
specifies how to represent NULLs:
|
1 |
time-format;null-format |
Special characters
The following table shows characters that have special meaning
in time display formats.
|
Character |
Meaning |
|---|---|
|
h |
Hour with no leading zero (for example, |
|
hh |
Hour with leading zero if appropriate (for |
|
m |
Minute with no leading zero (must follow h or |
|
mm |
Minute with leading zero if appropriate (must |
|
s |
Second with no leading zero (must follow m or |
|
ss |
Second with leading zero (must follow m or |
|
ffffff |
Microseconds with no leading zeros. You can enter |
|
AM/PM |
Two-character, uppercase abbreviation (AM or PM |
|
am/pm |
Two-character, lowercase abbreviation (am or pm |
|
A/P |
One-character, uppercase abbreviation (A or P as |
|
a/p |
One-character, lowercase abbreviation (a or p as |
Colons, slashes, and spaces display as entered in the
mask.
24-hour format is the default
Times display in 24-hour format unless you specify AM/PM,
am/pm, A/P, or a/p.
Time keyword
You can use the following keyword as a time display format to
specify the format specified in the Windows control panel:
[Time]
Examples
The following table shows how the time 9:45:33:234567 PM
displays when different format masks are applied.
|
Format |
Displays |
|---|---|
|
h:mm AM/PM |
9:45 PM |
|
hh:mm A/P |
09:45 P |
|
h:mm:ss am/pm |
9:45:33 pm |
|
h:mm |
21:45 |
|
h:mm:ss |
21:45:33 |
|
h:mm:ss:f |
21:45:33:2 |
|
h:mm:ss:fff |
21:45:33:234 |
|
h:mm:ss:ffffff |
21:45:33:234567 |
|
m/d/yy h:mm |
1/30/98 21:45 |