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 where the report server is located. You can use this function in a text box, text cell, or a row or column heading. The function syntax is:
<<Date ("format”,”TimeZoneId”)>>
where “format” (optional) defaults to user preference for date /time. Valid values are those accepted by JavaSimpleDateFormat, or “user” or empty (“user”).
user refers to the default date specified for preferences in EPM Workspace.
“TimeZoneId” (optional) defaults to user preferences for timezone. Valid values are those accepted by Java TimeZone.getTimeZone(), or “user” or “server”. For example, for TimeZone.getTimeZone(), to specify the east coast, you would type: "America/New_York".
user is the default date specified in EPM Workspace preferences.
server is the server time zone.
Note: | When using the “TimeZoneId” parameter, you must enclose the “format” parameter within quotes. This applies only when “TimeZoneId” is indicated. Existing reports prior to the “TimeZoneId” enhancement do not need to be updated. |
The following table lists all format date and time characters:
Table 40. 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: | |||
The number or count of format characters determines the exact 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.
For example, if the month is February:
<<Date("MM-yyyy")>> displays 02-2002
All upper and lower case alphabet characters are considered patterns, regardless of whether they are designated format characters.
If you want literal text, you must enclose that text within single quotes. If you want to use a single quote in literal text, you must 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' ")>>
The following table demonstrates some common date and time format options. Insert any of these in a report in locations that allows text.