Sun ONE logo     Previous      Contents      Index      Next     
Sun ONE Application Server 7 Developer's Guide to NSAPI



Time Formats

This module describes the format strings used for dates and times. These formats are used by some built-in SAFs such as append-trailer, and by server-parsed HTML (parse-html).

The following table describes the format strings for dates and times. The left column lists time format symbols, and the right column explains the meanings of the symbols.

   Time formats

Symbol

Meaning

%a

 

Abbreviated weekday name (3 chars)

 

%d

 

Day of month as decimal number (01-31)

 

%S

 

Second as decimal number (00-59)

 

%M

 

Minute as decimal number (00-59)

 

%H

 

Hour in 24-hour format (00-23)

 

%Y

 

Year with century, as decimal number, up to 2099

 

%b

 

Abbreviated month name (3 chars)

 

%h

 

Abbreviated month name (3 chars)

 

%T

 

Time "HH:MM:SS"

 

%X

 

Time "HH:MM:SS"

 

%A

 

Full weekday name

 

%B

 

Full month name

 

%C

 

"%a %b %e %H:%M:%S %Y"

 

%c

 

Date & time "%m/%d/%y %H:%M:%S"

 

%D

 

Date "%m/%d/%y"

 

%e

 

Day of month as decimal number (1-31) without leading zeros

 

%I

 

Hour in 12-hour format (01-12)

 

%j

 

Day of year as decimal number (001-366)

 

%k

 

Hour in 24-hour format (0-23) without leading zeros

 

%l

 

Hour in 12-hour format (1-12) without leading zeros

 

%m

 

Month as decimal number (01-12)

 

%n

 

line feed

 

%p

 

A.M./P.M. indicator for 12-hour clock

 

%R

 

Time "%H:%M"

 

%r

 

Time "%I:%M:%S %p"

 

%t

 

tab

 

%U

 

Week of year as decimal number, with Sunday as first day of week (00-51)

 

%w

 

Weekday as decimal number (0-6; Sunday is 0)

 

%W

 

Week of year as decimal number, with Monday as first day of week (00-51)

 

%x

 

Date "%m/%d/%y"

 

%y

 

Year without century, as decimal number (00-99)

 

%%

 

Percent sign

 


Previous      Contents      Index      Next     
Copyright 2002 Sun Microsystems, Inc. All rights reserved.