Question:
Using Impact WebService we capture the Ticket Close time from Remedy.
I observer Remedy sends the datetime in the below format. How to convert
the below format to NetCool UTC datetime format and display in NetCool
Dashboard.
*2016-02-23T20:45:09-08:00 -> with timezone embedded*
Answer:
The Impact ParseDate function is a wrapper for the Java SimpleDateFormat
class (
http://docs.oracle.com/javase/
The problem with your date string is the timezone. SDF and ParseDate by
extension expect it to be (+-)NNNN not (+/-)NN:NN.
Also, you have to escape the T using single quotes.
You did not say if you were using IPL or Javascript, but here is some IPL
that will work and verify that your data is in the expected format.
d="2016-02-23T20:45:09-08:00";
if(d like '(\d\d\d\d\-\d\d\-\d\dT\d\d:\
parts=RExtractAll(d,
'(\d\d\d\d\-\d\d\-\d\dT\d\d:\
tempDateString=parts[0]+parts[
Log(0,tempDateString);
f="yyyy-MM-dd'T'HH:mm:ssZ";
pd=ParseDate(tempDateString, f, null);
Log(pd);
}
else {
Log(0,"Unsupported date format!");
}