Date Format for the HotJava Browser Clock

The HotJavaTM Browser gives you the option to display a clock in the header, which by default indicates the date and time using this format:

Feb 2, 2:30 PM

You can change the format of the clock display by specifying the hotjava.clock.format property. See Customizing the HotJava Browser for information about editing properties files.

The property used to create the default format is
hotjava.clock.format=MMM d', 'h:mm a

The interpretation of this format is described by the elements in the table below. The hotjava.clock.format property must be specified using the syntax in this table.

Symbol | Meaning | Presentation | Example
--- | --- | --- | ---
a | AM/PM marker | Text | PM
d | Day in month | Number | 10
D | Day in year | Number | 189
E | Day in week | Text | Tuesday
F | Day of week in month | Text | 3 (result on 3rd Fri. in July)
G | Era designator | Text | AD
h | Hour in am/pm (1-12)* | Number | 12
k | Hour in day (1-24)* | Number | 24
H | Hour in day (0-23)* | Number | 0
K | Hour in am/pm (0-11)* | Number | 0
m | Minute in hour | Number | 30
M | Month in year | Text or Number | July or 07
s | Second in minute | Number | 55
S | Millisecond in minute | Number | 978
w | Week in year | Number | 27
W | Week in month | Number | 3
y | Year | Number | 1997
z | Time zone | Text | Pacific Standard Time
' | Delimits text |  |
'' | Single quote |  | '

*The difference between the upper- and lower-case h and k patterns (h, k, H, and K) occurs only at the noon and midnight hours. If you use the lower-case patterns (h and k), these hours produce the numbers 12 or 24. If you use the upper-case pattern H, the number 0 is used at the midnight hour. The upper-case pattern K produces 0 at midnight and noon.

The number of letters in each pattern determines whether a long or short format is used for that element.

For the cases where Presentation=Text, if there are 4 or more letters in the pattern, the full format is created. If there are 3 or fewer letters, an abbreviated form is used if it exists. For example, a format using E, EE, or EEE would all produce Sun, Mon, etc., while EEEE would result in Sunday, Monday, and so on. Similarly, z might produce PST, while zzzz in the same time zone would result in Pacific Standard Time.

For the patterns that produce numbers, the number of letters in the pattern determines the minimum number of digits. For example, h results in 4 at 4:00, while hh results in 04. Year is a special case, in that yy produces a truncated year (e.g. 97).

For month (M), which produces text or a number, use 1 or 2 M's to get a number (e.g. M produces 2 and MM produces 02 for February). Use 3 M's for abbreviated text (MMM creates Feb), and use 4 or more M's for full text (MMMM creates February).

Any characters in a pattern that aren't letters are treated as quoted text. Therefore you don't need to quote special characters such as comma, colon, space, ampersand, and so on.

Here are some examples of hotjava.clock.format values, and what they might produce:

Format Pattern | Result
--- | ---
MMM d',' h:mm a | Feb 2, 2:30 PM (the default format)
yyyy.MM.dd G 'at' hh:mm:ss z | 1997.07.09 AD at 15:08:56 PDT
EEE, MMMM d, ''yy | Wed, July 9, '97
hh 'o''''clock' a, zzzz | 12 o'clock PM, Pacific Daylight Time
yyyy.MMMM.dd GGG hh:mm aaa | 1997.July.09 AD 12:08 PM

Back to HotJava Browser Display Preferences

Back to Customizing the HotJava Browser