Integration Cloud 6.6.0 | Built-In Services | Built-In Services | dateTimeFormat
 
dateTimeFormat
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 the “Notes on Invalid Dates” section.
currentPattern
String Pattern string that describes the format of inString. For pattern-string notation, see the “Pattern String Symbols” section.
newPattern
String Pattern string that describes the format in which you want inString returned. For pattern-string syntax, see the “Pattern String Symbols” section.
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.
lenient
String Optional. A flag indicating whether an exception will appear 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, the date in the format specified in the currentPattern parameter will be interpreted and returned. If the interpretation is incorrect, the service will return an invalid date.
*false to perform a strict check.
In a strict check, an exception will appear 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 the “Notes on Invalid Dates" section, if the pattern yy is used for the year, dateTimeFormat uses a 50-year moving window to interpret the value of the year.
If currentPattern does not contain a time zone, the value is assumed to be in the default time zone.
If newPattern contains a time zone, the default time zone is used.