Date and time formats

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

Table 1. Date/Time format specifiers
Format specifier Description Examples
%a 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)

%A 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)

%b 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)

%B 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)

%C The number of the century.

6/1/2009 1:45:30 PM -> 20
6/1/1992 1:45:30 PM -> 19

%d 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

%e 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

%H The hour, using a 24-hour clock from 00 to 23.

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

%I The hour, using a 12-hour clock from 01 to 12.

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

%j The day of the year from 000 to 366.

1/5/2009 1:45:30 AM -> 015
6/15/2009 1:45:30 PM -> 166

%k The hour, using a 24-hour clock from 0 to 23.

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

%l The hour, using a 12-hour clock from 1 to 12.

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

%m The month, from 01 through 12.

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

%M The minute, from 00 through 59.

6/15/2009 1:09:30 AM -> 09
6/15/2009 1:09:30 PM -> 09

%n The newline character.  
%p The AM/PM designator.

6/15/2009 1:45:30 PM -> PM (en-US)
6/15/2009 1:45:30 PM -> 午後 (ja-JP)
6/15/2009 1:45:30 PM -> PM (es-ES)

%P The am/pm designator.

6/15/2009 1:45:30 PM -> pm (en-US)

%S The second, from 00 through 59.

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

%s The number of seconds since Epoch (since Jan 01 1970 00:00:00 UTC).

6/15/2009 1:45:09 PM -> 1245073509

%t The tab character.  
%u The day of the week from 1 to 7 (1 = Sunday)

6/15/2009 1:45:09 PM -> 2

%U The week of the year, starting with the first Sunday as the first day of the first week (00..53). 12/09/2001 -> 48
%V The week of the year Monday through Sunday according to ISO-8601, starting with the week that contains the year's first Thursday (01..53). 12/09/2001 -> 50
%W The week of the year, starting with the first Monday as the first day of the first week (00..53). 12/09/2001 -> 49
%y The year, from 00 to 99.

1/1/0001 12:00:00 AM -> 01
1/1/0900 12:00:00 AM -> 00
6/5/1975 1:45:09 PM -> 75
6/5/2009 1:45:09 PM -> 09

%Y The year as a four-digit number.

1/1/0001 12:00:00 AM -> 0001
1/1/0900 12:00:00 AM -> 0900
1/1/1900 12:00:00 AM -> 1900
6/15/2009 1:45:30 PM -> 2009

%% The literal % character.

%%Y -> %Y