Formatting the DateTime control
Last Update: October 30, 2017
Here are examples on how to format the DateTime control using Format property of the DateTime control.

Date|Time Format Table
10/10/2017 | m/d/Y H:i:s a | 10/10/2017 11:52:25 am |
10/10/2017 | F d, Y | October 10, 2017 |
10/10/2017 | M d, Y | Oct 10, 2017 |
10/10/2017 | M d, y | Oct 10, 17 |
10/10/2017 | M d, y g:i | Oct 10, 17 12:03 |
10/10/2017 | M d, y g:i:s | Oct 10, 17 12:04:23 |
10/10/2017 | m/d/Y H:i:s a | 10/10/2017 12:13:09 pm |
The following characters are recognized in the Format property of the DateTime control. The format specified in the Format property should be a correct datetime format, otherwise the control will show today’s date|time (see the above examples).
Day |
F | A full textual representation of a month, such as January or March |
M | Numeric representation of a month, with leading zeros |
M | A short textual representation of a month, three letters |
N | Numeric representation of a month, without leading zeros |
Year |
Y | A full numeric representation of a year, 4 digits |
Y | A two digit representation of a year |
Time |
A | Lowercase Ante meridiem and Post meridiem |
A | Uppercase Ante meridiem and Post meridiem |
B | Swatch Internet time |
g | 12-hour format of an hour without leading zeros |
G | 24-hour format of an hour without leading zeros |
h | 12-hour format of an hour with leading zeros |
H | 24-hour format of an hour with leading zeros |
i | Minutes with leading zeros |
s | Seconds, with leading zeros |
u | Microseconds. Will always generate 000000. |