The dateTimeLib.intervalValueWithPattern() system function returns an INTERVAL value that reflects a string and (optionally) is built based on an interval pattern that you specify. For example, if the pattern is "yyyy", the input string must contain four digits, and those digits represent the number of years represented in the interval.
dateTimeLib.intervalValueWithPattern( intervalAsString STRING? in [, intervalPattern STRING? in ]) returns (result INTERVAL?)