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.
<<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
If the month is July: M displays: 7 MM displays: 07 MMM displays: Jul MMMM displays: July | |||
<<Date(“dd-MMM-yy ‘is the’ F 'th ' E 'of' ‘MMM”)>> displays: | |||
Considerations when using format characters:
The number or count of format characters determines the format:
For example, if the date is April 24:
<<Date("dd-M-yy")>> displays 24-4-02
<<Date("dd-MM-yy”)>> displays 24-04-02
<<Date("dd-MMM-yy")>> displays 24-Apr-02
<<Date("dd-MMMM-yy")>> displays 24-April-02
For numbers, the number of pattern letters is the minimum number of digits. Shorter numbers are padded with zeros. Year is a special case. If you use “yy”, the last two digits of the year are displayed, but if you use “yyyy,” the four-digit year is displayed.
All upper and lower case alphabet characters are considered patterns, regardless of whether they are designated format characters.
Enclose literal text within single quotation marks. To use a single quotation mark in literal text, enclose the text within single quotes and use two single quotes for the apostrophe.
For example, the format to print 4 o’clock is:
<<Date("hh 'o''clock' ")>>