DateTimes are stored in a proprietary internal format. However, date & times must be in OI's internal format when passing them to properties. SRP ActiveX Controls will not parse string date & times on your behalf.
You can use any characters in the format, but 'Y', 'y', 'M', 'm', 'D', 'd', 'H', 'h', 'S', 's', 'A', 'a', and '0' are reserved characters. Any other character is treated as a literal and is displayed as is. Thus, you may use literal characters in your format to prefix or suffix the data as you choose. If you need to use any reserved characters literally, then surround your literal text in single or double quotes. If you need to display quotes, place two of them side by side. The reserved characters are interpreted as follows:
Character(s) | Displays |
---|---|
YY | Years 00-99 |
YYYY | Years 0001-2999 |
M | Months 1-12 |
MM | Months 01-12 |
MMM | Months Jan-Dec |
MMMM | Months January-December |
MMMMM | Months J-D |
D | Days 1-31 |
DD | Days 01-31 |
DDD | Days Sun-Sat |
DDDD | Days Sunday-Saturday |
h | Hours 0-23 |
hh | Hours 00-23 |
m | Minutes 0-59 |
mm | Minutes 00-59 |
s | Seconds 0-59 |
ss | Seconds 00-59 |
0 | Milliseconds 0-9 (rounded to the nearest tenth) |
00 | Milliseconds 00-99 (rounded to the nearest hundredth) |
000 | Milliseconds 000-999 |
a | a/p |
aa | am/pm |
aaa | a.m./p.m. |
A | A/P |
AA | AM/PM |
AAA | A.M./P.M. |
Note that 'M' must be used for months and 'm' for minutes. All other codes can be either case.
Here are some example date & time formats, all of them for the date & time January 1, 2006 at 3:30:30.245 PM:
To Display As | Use |
---|---|
January 1, 2006 at 3:30 PM | MMMM D, YYYY 'at' h:mm aa |
Sunday, Jan 01, 2006 | DDDD, MMM DD, YYYY |
2006-01-01 15:30:30 | YYYY-MM-DD hh:mm:ss |