Date and Time Specification

To specify the date and time format so that it can be parsed from a file receiver, (File Receiver, Folder Follower Receiver, or File Transfer), refer to Date/Time Format Specification. Internally, Logger uses a common Java method called SimpleDateFormat. Sophisticated uses of SimpleDateFormat, as described in Java sources, will work with Logger. Pattern letters are usually repeated, as their number determines the exact presentation.

The following examples show how date and time patterns are interpreted in the U.S. locale. The given date and time are July 4th 2013, at 12:08:56 local time, in the “U.S. Pacific Time” time zone.

Date/Time Examples

Source

Date and Time Pattern

2013.07.04 AD at 12:08:56 PDT

yyyy.MM.dd G 'at' HH:mm:ss z

Wed, Jul 4, '13

EEE, MMM d, ''yy

12:08 PM

h:mm a

12 o'clock PM, Pacific Daylight Time

hh 'o'clock' a, zzzz

0:08 PM, PDT

K:mm a, z

2013.July.04 AD 12:08 PM

yyyyy.MMMMM.dd GGG hh:mm aaa

Wed, 4 Jul 2013 12:08:56 -0700

EEE, d MMM yyyy HH:mm:ss Z

130704120856-0700

yyMMddHHmmssZ

2013-07-04T12:08:56.235-0700

yyyy-MM-dd'T'HH:mm:ss.SSSZ

Date/Time Format Specification

Symbol

Meaning

Presentation

Examples

G

Era designator

(Text)

AD

y

Year

(Number)

2013 or 13

M

Month in year (1-12)

(Month)

July or Jul or 07

w

Week in year (1-52)

(Number)

39

W

Week in month (1-5)

(Number)

2

D

Day in year (1-366)

(Number)

129

d

Day in month (1-31)

(Number)

10

E

Day in week

(Text)

Tuesday or Tue

F

Day in week of month

 

 

a

Am/pm marker

(Text)

AM or PM

H

Hour in day (0-23)

(Number)

0

k

Hour in day (1-24)

(Number)

24

K

Hour in am/pm (0-11)

(Number)

0

h

Hour in am/pm (1-12)

(Number)

12

m

Minute in hour (0-59)

(Number)

30

s

Second in minute (0-59)

(Number)

55

S

Millisecond (0-999)

(Number)

978

z

Time zone

(Text)

Pacific Standard Time, or PST, or GMT-08:00

Z

Time zone

(RFC 822)

-0800 (indicating PST)

Concept Link IconSee Also