You can format a date and/or time in a predefined format or in a format that you define.
The formats featured in this topic only apply to these GainSeeker modules:
The formats used for the Dynamic Reports and GainSeeker Charts version 8.2 and later modules are likely to differ from those featured in this topic. See Date/Time formats for information applicable to these modules.
Predefined date/time formats
The following table identifies the predefined date and time format names:
Format Name |
Description |
General Date |
Display a date and/or time. For real numbers, display a date and time, for example, 4/3/93 05:34 PM. If there is no fractional part, display only a date, for example, 4/3/93. If there is no integer part, display time only, for example, 05:34 PM. Date display is determined by the workstation's regional options. |
Long Date |
Display a date according to the long date format in the workstation's regional options. |
Medium Date |
Display a date using the medium date format appropriate for the language version of the host application. |
Short Date |
Display a date according to the short date format in the workstation's regional options. |
Long Time |
Display a time according to the time format in your regional options; includes hours, minutes, seconds. |
Medium Time |
Display time in 12-hour format using hours and minutes and the AM/PM designator in the workstation's regional options. |
Short Time |
Display a time using the 24-hour format, for example, 17:45. |
User-defined date/time formats
The following table identifies characters you can use to create user-defined date/time formats:
Character |
Description |
(:) |
Time separator. The time separator separates hours, minutes, and seconds when time values are formatted. The actual character used as the time separator in formatted output is determined by the time separator in the workstation's regional options. |
(/) |
Date separator. The date separator separates the day, month, and year when date values are formatted. The actual character used as the date separator in formatted output is determined by the date separator in the workstation's regional options. |
c |
Display the date as ddddd and display the time as ttttt, in that order. Display only date information if there is no fractional part to the date serial number; display only time information if there is no integer portion. |
d |
Display the day as a number without a leading zero (1 – 31). |
dd |
Display the day as a number with a leading zero (01 – 31). |
ddd |
Display the day as an abbreviation (Sun – Sat). |
dddd |
Display the day as a full name (Sunday – Saturday). |
ddddd |
Display the date as a complete date (including day, month, and year), according to the short date format in the workstation's regional options. |
dddddd |
Display a date serial number as a complete date (including day, month, and year) according to the long date format in the workstation's regional options. |
w |
Display the day of the week as a number (1 for Sunday through 7 for Saturday). |
ww |
Display the week of the year as a number (1 – 54). |
m |
Display the month as a number without a leading zero (1 – 12). If m immediately follows h or hh, the minute rather than the month is displayed. |
mm |
Display the month as a number with a leading zero (01 – 12). If m immediately follows h or hh, the minute rather than the month is displayed. |
mmm |
Display the month as an abbreviation (Jan – Dec). |
mmmm |
Display the month as a full month name (January – December). |
q |
Display the quarter of the year as a number (1 – 4). |
y |
Display the day of the year as a number (1 – 366). |
yy |
Display the year as a 2-digit number (00 – 99). |
yyyy |
Display the year as a 4-digit number (100 – 9999). |
h |
Display the hour as a number without leading zeros (0 – 23). |
hh |
Display the hour as a number with leading zeros (00 – 23). |
n |
Display the minute as a number without leading zeros (0 – 59). |
nn |
Display the minute as a number with leading zeros (00 – 59). |
s |
Display the second as a number without leading zeros (0 – 59). |
ss |
Display the second as a number with leading zeros (00 – 59). |
ttttt |
Display a time as a complete time (including hour, minute, and second), formatted according to the time format in your regional options. A leading zero is displayed if the leading zero option is selected and the time is before 10:00 A.M. or P.M. |
AM/PM |
Use the 12-hour clock and display an uppercase AM with any hour before noon; display an uppercase PM with any hour between noon and 11:59 P.M. |
am/pm |
Use the 12-hour clock and display a lowercase AM with any hour before noon; display a lowercase PM with any hour between noon and 11:59 P.M. |
A/P |
Use the 12-hour clock and display an uppercase A with any hour before noon; display an uppercase P with any hour between noon and 11:59 P.M. |
a/p |
Use the 12-hour clock and display a lowercase A with any hour before noon; display a lowercase P with any hour between noon and 11:59 P.M. |
AMPM |
Use the 12-hour clock and display the AM portion of the AM/PM designator in the workstation's regional options with any hour before noon; display the PM portion of the AM/PM designator in the workstation's regional options with any hour between noon and 11:59 P.M. AMPM can be either uppercase or lowercase, but the case of the string displayed matches the portion of the AM/PM designator in the workstation's regional options. |
More: