Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Date and Time Formats
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Date and Time Formats
■ Default settings for date and time formats are determined by the operating
system.
■ Visual Basic supports international formatting styles under MS-DOS
version 3.31 or later. See: ◄FORMAT$ Function►
■ Date/time serial numbers can be formatted with date/time formats or with
numeric formats, since date/time serial numbers are stored as floating-
point values. Date and time formats are:
Symbol Description
══════ ══════════════════════════════════════════════════════════
d Display the day as a number without leading zeros (1-31)
dd Display the day as a number with leading zeros (01-31)
ddd Display the day as an abbreviation (Sun-Sat)
dddd Display the day as a full name (Sunday-Saturday)
ddddd Display a serial date number as a complete date
(including day, month, and year)
m Display the month as a number without leading zeros (1-12);
if used immediately following h or hh, the minute rather
than the month is displayed
mm Display the month as a number with leading zeros (01-12);
if used immediately following 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 name (January-December)
y Display the year as a two-digit number (00-99)
yyyy Display the year as a four-digit number (1900-2040)
h Display the hour as a number without leading zeros (0-23)
hh Display the hour as a number with leading zeros (00-23)
m Display the minute as a number without leading zeros
(0-59); if not used immediately following h or hh, the
month rather than the minute is displayed
mm Display the minute as a number with leading zeros (00-59);
if not used immediately following h or hh, the month rather
than the minute is displayed.
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 serial number as a complete time, including
hour, minute, and second
AM/PM (Default) Use the 12-hour clock displaying AM or am with
am/pm any hour before noon; PM or pm with any hour between noon
and 11:59
A/P Use the 12-hour clock displaying A or a with any hour
a/p before noon; P or p with any hour between noon and 11:59
───────────────────────────────────────────────────────────────────
See: ◄Date and Time Command Summary► ◄Sample Date and Time Formats►