Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Integration Server Built-In Services | Date Folder | Summary of Elements in this Folder | pub.date:dateTimeFormat
 
pub.date:dateTimeFormat
WmPublic. Converts date/time (represented as a String) string from one format to another.
Input Parameters
inString
String Date/time that you want to convert.
Important:
If inString contains a character in the last position, that character is interpreted as 0. This can result in an inaccurate date. For information about invalid dates, see Notes on Invalid Dates.
currentPattern
String Pattern string that describes the format of inString. For pattern-string notation, see Pattern String Symbols.
newPattern
String Pattern string that describes the format in which you want inString returned. For pattern-string syntax, see Pattern String Symbols.
locale
String Optional. Locale in which the date is to be expressed. For example, if locale is en (for English), the pattern EEE d MMM yyyy will produce Friday 23 August 2002, and the locale of fr (for French) will produce vendredi 23 août 2002.
If locale is not specified, Integration Server uses the value of the watt.server.session.locale.ignore server configuration parameter to determine whether the locale is obtained from the session used by the client that invoked the service or if the locale is the locale of Integration Server.
lenient
String Optional. A flag indicating whether Integration Server throws an exception if the inString value does not adhere to the format specified in currentPattern parameter. Set to:
*true to perform a lenient check. This is the default.
In a lenient check, if the format of the date specified in the inString parameter does not match the format specified in the currentPattern parameter, Integration Server interprets and returns the date in the format specified in the currentPattern parameter. If the interpretation is incorrect, the service will return an invalid date.
*false to perform a strict check.
In a strict check, the Integration Server throws an exception if the format of the date specified in the inString parameter does not match the format specified in the currentPattern parameter.
Output Parameters
value
String The date/time given by inString, in the format of newPattern.
Usage Notes
As described in Notes on Invalid Dates, if the pattern yy is used for the year, dateTimeFormat uses a 50-year moving window to interpret the value of the year. If you need to change this behavior so that the year is interpreted as 80 years before or 20 years after the current date (as described in the Java class java.text.SimpleDateFormat), set the server configuration parameter watt.server.pubDateTimeFormat.javaSlidingWindow to true. For information about setting configuration parameters, see webMethods Integration Server Administrator’s Guide.
By default, the Integration Server throws an exception if no input is passed to the service. To suppress the error message and return a null value for the value parameter, set the server configuration parameter watt.server.date.suppressPatternError to true. For information about setting configuration parameters, see webMethods Integration Server Administrator’s Guide.
If currentPattern does not contain a time zone, the value is assumed to be in the time zone of the webMethods Integration Server.
If newPattern contains a time zone, the time zone of the webMethods Integration Server is used.