Date

Date is a text function that returns the date and time that an online report is populated with data, or the date and time that a snapshot report is saved. The date and time is retrieved from the report server and corresponds to the country in which the report server is located. You can use Date in a text box, text cell, or a row or column heading.

Syntax:

<<Date("format”,”TimeZoneId”)>>

Argument

Description

format

Defaults to the user preference for date/time. Valid values are those accepted by Java SimpleDateFormat, or “user” or empty (“user”).

Date and time format characters are case-sensitive.

TimeZoneId

Defaults to user preferences for the time zone. Valid values are those accepted by Java TimeZone.getTimeZone(), or the server time zone. For example, for TimeZone.getTimeZone() to specify the east coast, enter: "America/New_York".

When using TimeZoneID, enclose the format parameter within quotation marks. This applies only when TimeZoneId is indicated. You do not need to update reports prior to the TimeZoneId enhancement.

Table 29. Date and Time Format Characters

Format Characters

Meaning

Data Type

Example

G

era designator

text

AD

M

month in year

text or number

If the month is July: M displays: 7 MM displays: 07 MMM displays: Jul MMMM displays: July

d

day in month

number

10

h

hour in am/pm (1-12)

number

11

H

hour in day (0-23)

number

22

m

minute in hour

number

30

s

second in minute

number

25

S

millisecond

number

978

E

day in week

text

E: Tue EE: Tuesday

D

day in year

number

189

F

day of week in month

number

<<Date(“dd-MMM-yy ‘is the’ F 'th ' E 'of' ‘MMM”)>> displays:

24-Dec-02 is the 4th Tue of Dec

w

week in year

number

27

W

week in month

number

2

a

am/pm marker

text

PM

k

hour in day (1-24)

number

23

K

hour in am/pm (0-11)

number

If the time is 3:37PM: 3

z

time zone

text

Pacific Standard Time

y

year

number

2002,02

'

literal text

text

<<Date(“ D’the day of ’yyyy”)>> displays:105th day of 2002

' '

two single quotes to produce one single quote

text

<<Date(“k:mm ‘O’’Clock’ a”)>> displays: 6:15 O’Clock PM

Note:

Use 2 single quotation marks to produce a single quote or an apostrophe as in O’Clock (O’’Clock).

Considerations when using format characters:

Examples:

Date Format  

Result

<<Date("d/M/yy")>>

23/3/02

<<Date("d-MMM-yy")>>

23-Mar-02

<<Date("EEEE, MMMM dd, yyyy")>>

Tuesday, March 23, 2002

<<Date("h:mm:ss a")>>

12:52:05 PM

<<Date("h:mm:ss a zzzz")>>

12:52:05 PM Eastern Standard Time

<<Date("EEEE, MMMM dd, yyyy G 'time:' h:mm:ss a zzzz")>>

Tuesday, March 23, 2002 AD time: 12:52:05 PM Eastern Standard Time

<<Date("hh 'o’’clock' a, zzzz")>>

12:00 PM, Eastern Standard Time

Note:

You must use two single quotation marks to produce one single quotation mark in the text of your formatted result.