Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Not Applicable | - |
Resolution:
Description:
==========
The DateTime.parseString function does not support UTC format (ISO 8601) which needs to be parsed:
code fragment:
String GMTTime = "2008-09-18T15:20:30.45Z";
DateTime dt = DateTime.parseString(GMTTime, "yyyy-MM-ddTHH:mm:ss.SSZ");
The code above produces the following exception:
2008 Sep 17 09:12:52:798 GMT -5 ICS-06255A.upcorp.ad.uprr.com Error [main] - [time] Got runtime exception while invoking Action be.gen.time.BE$$Actions$Startup@33788d Objects <>
java.lang.IllegalArgumentException: Illegal pattern character 'T'
Environment:
==========
o TIBCO BusinessEvents 2.2 and above
o All OS
Cause :
==========
Date and time formats are specified by /date and time pattern/ strings. Within date and time pattern strings, unquoted letters from
|'A'| to |'Z'| and from |'a'| to |'z'| are interpreted as pattern letters representing the components of a date or time string. Text can be quoted using single quotes (|'|) to avoid interpretation. All other characters are not interpreted; they're simply copied into the output string during formatting or matched against the input string during parsing.
Symptoms:
=========
2008 Sep 17 09:12:52:798 GMT -5 ICS-06255A.upcorp.ad.uprr.com Error [main] - [time] Got runtime exception while invoking Action be.gen.time.BE$$Actions$Startup@33788d Objects <>
java.lang.IllegalArgumentException: Illegal pattern character 'T'
Reference
=========
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html.
Resolution:
=========
Please modify your code as follows to correct the problem.
String GMTTime = "2008-09-18T15:20:30.45Z";
DateTime dt = DateTime.parseString(GMTTime, "yyyy-MM-dd'T'HH:mm:ss.ss'Z'");