Time Formats

                                                                                                                                                                                                                                                                                                                                      Back to [Book]     [Topic]

Time Formats

The following table describes the format strings for dates and times used by server-parsed HTML.

Table 2-1 Time Formats

Symbol Meaning
%a Abbreviated weekday name (3 characters)
%d Day of month as decimal number (01-31)
%S Second as decimal number (00-59)
%M Minute as decimal number (00-59)
%H Hour in 24-hour format (00-23)
%Y Year with century, as decimal number, up to 2099
%b Abbreviated month name (3 characters)
%h Abbreviated month name (3 characterss)
%T Time "HH:MM:SS"
%X Time "HH:MM:SS"
%A Full weekday name
%B Full month name
%C "%a %b %e %H:%M:%S %Y"
%c Date & time "%m/%d/%y %H:%M:%S"
%D Date "%m/%d/%y"
%e Day of month as decimal number (1-31) without leading zeros
%I Hour in 12-hour format (01-12)
%j Day of year as decimal number (001-366)
%k Hour in 24-hour format (0-23) without leading zeros
%l Hour in 12-hour format (1-12) without leading zeros
%m Month as decimal number (01-12)
%n Line feed
%p A.M./P.M. indicator for 12-hour clock
%R Time "%H:%M"
%r Time "%I:%M:%S %p"
%t Tab
%U Week of year as decimal number, with Sunday as first day of week (00-51)
%w Weekday as decimal number (0-6; Sunday is 0)
%W Week of year as decimal number, with Monday as first day of week (00-51)
%x Date "%m/%d/%y"
%y Year without century, as decimal number (00-99)
%% Percent sign

Labels

java java Delete
server server Delete
sun sun Delete
webserver webserver Delete
application application Delete
system system Delete
webtier webtier Delete
guide guide Delete
webserver70 webserver70 Delete
sunjava sunjava Delete
+devguide +devguide Delete
developers developers Delete
web web Delete
developersguide developersguide Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact