Date and time formats

Date and time format strings define text representation of a date/time value for a Date/Time form field.

jQuery date/time format specifiers

A date format may consist of any combination of format specifiers and literal text described in the following table.

Format specifier Description Examples
d
The day of the month, from 1 through 31.

6/1/2009 1:45:30 PM -> 1
6/15/2009 1:45:30 PM -> 15

dd
The day of the month, from 01 through 31.

6/1/2009 1:45:30 PM -> 01
6/15/2009 1:45:30 PM -> 15

o
The day of the year, from 1 through 365.

6/1/2009 1:45:30 PM -> 152
6/15/2009 1:45:30 PM -> 166

o
The day of the year, from 001 through 365.

2/15/2009 1:45:30 PM -> 046
6/15/2009 1:45:30 PM -> 166

D
The abbreviated name of the day of the week.

6/15/2009 1:45:30 PM -> Mon (en-US)
6/15/2009 1:45:30 PM -> Пн (ru-RU)
6/15/2009 1:45:30 PM -> lun. (fr-FR)

DD
The full name of the day of the week.

6/15/2009 1:45:30 PM -> Monday (en-US)
6/15/2009 1:45:30 PM -> понедельник (ru-RU)
6/15/2009 1:45:30 PM -> lundi (fr-FR)

m
The month of the year 1 through 12.

6/1/2009 1:45:30 PM -> 6
12/15/2009 1:45:30 PM -> 12

mm
The month of the year 01 through 12.

6/1/2009 1:45:30 PM -> 06
12/15/2009 1:45:30 PM -> 12

M
The abbreviated name of the month.

6/15/2009 1:45:30 PM -> Jun (en-US)
6/15/2009 1:45:30 PM -> juin (fr-FR)
6/15/2009 1:45:30 PM -> Jun (zu-ZA)

MM
The full name of the month.

6/15/2009 1:45:30 PM -> June (en-US)
6/15/2009 1:45:30 PM -> juni (da-DK)
6/15/2009 1:45:30 PM -> uJuni (zu-ZA)

y
The year two digits.

6/1/2009 1:45:30 PM -> 09
6/1/2010 1:45:30 PM -> 10

yy
The year four digits.

6/1/2009 1:45:30 PM -> 2009
6/1/2010 1:45:30 PM -> 2010

@
Unix timestamp (milliseconds since 01/01/1970).

6/1/2009  1:45:30 PM -> 1243863930000
6/15/2009 1:45:30 PM -> 1245073530000

!
Windows ticks (100 nanaseconds since 01/01/0001.

6/1/2009 1:45:30 PM -> 3.42131313e+16
6/15/2009 1:45:30 PM -> 3.42252273e+16

'character string'
Delimits literal text.

m-d-yy 'C.E.'  -> 6-1-2009 C.E.

''
Single quote.

Don''t -> Don't

other character strings
Literal text. Start -> Start