Supported Date and Time Format Codes

When formatting a date/time mask, such as a custom date/time format for the field properties in a message definition, you can use the following format codes to compose the date/time template.

Supported date and time format codes

Format codeExample string

Era

G

AD

Year

yy

05

For yy, the year is truncated to 2 digits; otherwise it is interpreted as a number.

yyyy

2005

yyyyy

02005

Month in Year

M

8

MM

08

MMM

Aug

MMMM

August

Week in Year

w

34

www

034

Week in Month

W

3

WW

03

Day in Year

D

227

DDDD

0227

Day in Month

d

15

ddd

015

Day of Week in Month

F

3

FF

03

Day in Week
E

Mon

EEEE

Monday

Am/pm Marker
a

AM

Hour in day (0-23)
H

11

HHH

011

Hour in day (1-24)
k

23

kkk

023

Minute in Hour
m

39

mm

39

mmm

039

Second in Minute
s

59

sss

059

Milliseconds
S

0

SSS

000 (milliseconds)

Time zone (General)
z

MST

zzzz

Mountain Standard Time

Time Zone (RFC 822)
Z

-0700

Adding a Field to a Message Definition

Setting Message Definition Preferences

Supported Character Sets

Supported Datatypes

Supported Datatypes for HL7 Messages

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com