​​​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.
Formatting the DateTime control1.jpg

Date|Time Format Table

Input Date Format​​ Result
10/10/2017m/d/Y H:i:s a10/10/2017 11:52:25 am
10/10/2017F d, YOctober 10, 2017
10/10/2017M d, YOct 10, 2017
10/10/2017M d, yOct 10, 17
10/10/2017M d, y g:iOct 10, 17 12:03
10/10/2017M d, y g:i:sOct 10, 17 12:04:23
10/10/2017m/d/Y H:i:s a10/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).

FormatDescription
Day​​
FA full textual representation of a month, such as January or March
MNumeric representation of a month, with leading zeros
MA short textual representation of a month, three letters
NNumeric representation of a month, without leading zeros
Year
YA full numeric representation of a year, 4 digits
YA two digit representation of a year
Time
ALowercase Ante meridiem and Post meridiem
AUppercase Ante meridiem and Post meridiem
BSwatch Internet time
g12-hour format of an hour without leading zeros
G24-hour format of an hour without leading zeros
h12-hour format of an hour with leading zeros
H24-hour format of an hour with leading zeros
iMinutes with leading zeros
sSeconds, with leading zeros
uMicroseconds. Will always generate 000000.