My Oracle Support Banner

How to Change the Format for Date and Time in the Content Server (Doc ID 445341.1)

Last updated on MARCH 05, 2024

Applies to:

Oracle WebCenter Content - Version 7.0 to 12.2.1.4.0 [Release Stellent to 12c]
Information in this document applies to any platform.
-----
Content Server 5x, 6x, 7.0, 7.0.1, 7.1, 7.1.1 *** ***


Goal

Your Content Server displays a two digit date for the year and you want to display a four digit date. How can you set the Content Server to use a different format for the date and time?

Date formats are unique to languages and locales. Within Content Server, the date format a user sees is determined by number of settings including the User Locale assigned to a user. When working with date formats, languages, encoding, and locales, you should also see the documentation guides described below (under More Information) which provide additional solutions involving other languages, dates, and encoding.

The default date format for the English-US locale appears with a one digit month, one digit day, two digit year, time, and am/pm marker for example:

6/24/04 10:54 AM

This format can be changed using the localization settings within the utility for System Properties. For example, the default Date/Time Format setting that generates this format for the English locale is:

M/d/yy {h:mm[:ss] {aa}[zzz]}!mAM,PM

The typical date format is separated into 3 distinct areas:

The date: M/d/yy
The time: {h:mm[:ss] {aa}[zzz]}
Additional formatting: !mAM,PM

In the above example, the brackets [] hide data from the display and the seconds although tracked, are hidden in the display as well as the time zone. The am/pm marker is defined by {aa} and it’s display form is defined by the additional formatting: either AM or PM.

Administrators can change the pattern assigned to this setting to display a different date format. The patterns used in the Date/Time format come directly from Java and can use the following options:

       

Pattern Options

Symbol

Meaning

Presentation

Example

G

era designator

Text

AD

y

year

Number

1996

M

month in year

Text & Number

July & 07

d

day in month

Number

10

h

hour in am/pm (1-12)

Number

12

H

hour in day (0-23)

Number

0

m

minute in hour

Number

30

s

second in minute

Number

55

S

millisecond

Number

978

E

day in week

Text

Tuesday

D

day in year

Number

189

F

day of week in month

Number

2 (2nd Wed in July)

w

week in year

Number

27

W

week in month

Number

2

a

am/pm marker

Text

PM

k

hour in day (1-24)

Number

24

K

hour in am/pm (0-11)

Number

0

z

time zone

Text

Pacific Standard Time

'

escape for text

Delimiter

(none)

'

single quote

Literal

'

Characters that are not letters are treated as quoted text. That is, they will appear in the formatted text even if they are not enclosed within single quotes.

The number of symbol letters you specify also determines the format. For example, if the "zz" pattern results in "PDT," then the "zzzz" pattern generates "Pacific Daylight Time." The following table summarizes these rules:

     

Pattern Rules

Presentation

Number of Symbols

Result

Text

1 - 3

abbreviated form, if one exists

Text

>= 4

full form

Number

minimum number of digits is required

shorter numbers are padded with zeros (for a year, if the count of 'y' is 2, then the year is truncated to 2 digits)

Text & Number

1 - 2

text form

Text & Number

3

number form

Shown below are some examples of date formats that can be used to obtain unique views of the date and time.

     

Example Patterns

Pattern

Display Result

System Result

M/d/yy {h:mm[:ss] {aa}[zzz]}!mAM,PM

9/27/04 3:49 PM

9/27/04 3:51:51 PMAmerica/Chicago

M/d/yy {h:mm[:ss] {aa}[zzz]}!mMorning,Afternoon

9/27/04 3:54 Afternoon

9/27/04 3:54 Afternoon

EEEE MMMM d yyyy {HH:mm[:ss][:SSS]}

Monday September 27 2004 16:02

Monday September 27 2004 16:03:36:701

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.