Use date formatting to convert the Date object to a human readable string. Several methods support standard and custom date formats.
- kendo.format
- kendo.toString
Standard Date Formats
Format | Pattern | Example | Result |
---|---|---|---|
d | Short date ("M/d/yyyy" for en-US) | kendo.toString(new Date(2000, 10, 6), "d") | 11/6/2000 |
D | Long date (dddd, MMMM dd, yyyy" for en-US) | kendo.toString(new Date(2000, 10, 6), "D") | Monday, November 06, 2000 |
F | Full date/time ("dddd, MMMM dd, yyyy h:mm:ss tt" for en-US) | kendo.toString(new Date(2000, 10, 6), "D") | Monday, November 06, 2000 12:00:00 AM |
g | General date/time (short time) (M/d/yyyy h:mm tt" for en-US) | kendo.toString(new Date(2000, 10, 6), "g") | 11/6/2000 12:00 AM |
G | General date/time (long time) (M/d/yyyy h:mm:ss tt" for en-US) | kendo.toString(new Date(2000, 10, 6), "G") | 11/6/2000 12:00:00 AM |
M/m | Month/day ("MMMM dd" for en-US) | kendo.toString(new Date(2000, 10, 6), "m") | November 06 |
u | Universal sortable date/time ("yyyy'-'MM'-'dd HH':'mm':'ss'Z" for en-US) | kendo.toString(new Date(2000, 10, 6), "u") | 2000-11-06 00:00:00Z |
Y/y | Year/month ("MMMM, yyyy" for en-US) | kendo.toString(new Date(2000, 10, 6), "y") | November, 2000 |
Custom Date Formats
Format | Description | Range/Example |
---|---|---|
d | Day of the month. | 1-31 |
dd | Day of the month. | 01-31 |
ddd | Abbreviated weekday name. | Sun, Mon, Tue |
dddd | Full weekday name. | Wednesday, Thursday, Friday, Saturday |
f | Tenths of seconds in a date and time value. | 12:00:10 |
ff | Hundredths of seconds in a date and time value. | 12:00:01 |
fff | Milliseconds in a date and time value. | 12:00:001 |
M | Month | 1-12 |
MM | Month | 01-12 |
MMM | Abbreviated month name. | Jan, Feb, Mar, Apr |
MMMM | Full month name | May, June, July, August |
h | Hour in 12-hour clock format. | 1-12 |
hh | Hour in 12-hour clock format. | 01-12 |
H | Hour in 24-hour clock format. | 1-23 |
HH | Hour in 24-hour clock format. | 01-23 |
m | Minutes | 0-59 |
mm | Minutes | 00-59 |
s | Seconds | 0-59 |
ss | Seconds | 00-59 |
tt | AM/PM designation | - |