Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 20 XPath Formula Builder : Date and Time Functions

Date and Time Functions
There are some functions in the XPath formula builder that allow you to parse or format strings that represent dates and times. These functions are:
format-dateTime(format, dateTime)
format-date(format, date)
format-time(format, time)
parse-dateTime(format, string)
parse-date(format, string)
parse-time(format, string)
The format parameter of these functions is based on the format patterns available for the java.text.SimpleDateFormat Java class. In the format parameter, unquoted alphabetic characters from A to Z and a to z represent the components of the date or time string. You can include non-pattern alphabetic characters in the string by quoting the text with single quotes. To include a single quote, use ’’. Table 39 describes the alphabetic characters and their associated presentation in a date or time string.
 
Four or more Gs return the full name of the era.
Two ys return two-digit year.
Three or more Ms return text name.
Four or more Es return the full name of the weekday.
Four or more as return the full name.
For any format pattern letter that returns a numeric value (for example, w, h, and m), the number of letters in the format pattern represents the minimum number of digits. For formatting functions, if the date or time has fewer digits than the number of pattern letters, the output is padded with zeros. For parsing functions, when the date or time has fewer digits than the number of characters in the format pattern, the extra characters are ignored, unless they are needed to determine the boundaries of adjacent fields.
Table 40 illustrates some example date and time format patterns and the resulting string.

Copyright © TIBCO Software Inc. All Rights Reserved