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, use the format codes in the table to compose the date/time template.

Table 1. Supported date and time format codes
Format code Example 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
Related concepts
Custom Wire Formats
Related tasks
Developing a Message Definition
Developing a Custom Class to Transform a Message Definition Field

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.