Updated on 2024-03-18 GMT+08:00

Date and Time Mode

The date and time in the EL expression can be displayed in a user-specified format. The date and time format is specified by the date and time mode character string. The date and time mode character string consists of letters from A to Z and from a to z, as shown in Table 1.

Table 1 Letter description

Letter

Description

Example

G

Epoch

AD

y

Year

2001

M

Month in a year

July or 07

d

Day in a month

10

h

Hour in the 12-hour clock (1 to 12)

12

H

Hour in the 24-hour clock (0 to 23)

22

m

Minute

30

s

Second

55

S

Millisecond

234

E

Day of a week

Mon, Tue, Wed, Thu, Fri, Sat, or Sun

D

Date in the year

360

F

Day in a week of a month

2(second Wed. in July)

w

Week in a year

40

W

Week in a month

1

a

A.M. /P.M.

PM

k

Hour in the 24-hour clock (1 to 24)

24

K

Hour in the 12-hour clock (0 to 11)

10

z

Time zone

Eastern Standard Time

'

Text delimiter

None

"

Single quotation mark

No example

The date and time mode is generally used in DateUtil embedded objects and Job embedded objects. For more examples of how the date and time mode is used, see DateUtil Embedded Objects and Job Embedded Objects.

Example

To obtain the date of the day before the planned scheduling time of a job, use the following EL expression:

#{DateUtil.format(DateUtil.addDays(Job.planTime,-1),"yyyy-MM-dd")}