Unable to Extract correct date time from Json using Deserialize activity

Hello All,

Can you please help me to extract the date time from below Json (eventDateTime). I am able to extract all fields using Deserialize activity However, while extracting the Eventdatetime its capturing some wrong date time because of timezone.

{
“events”: [
{
“eventType”: “TRANSPORT”,
“eventDateTime”: “2022-02-19T07:12:00+01:00”,
“eventCreatedDateTime”: “2022-03-14T10:40:52Z”,
“transportCall”: {
“facilityTypeCode”: “POTE”,
“modeOfTransport”: “VESSEL”,
“UNLocationCode”: “ITLIV”
}
},
{
“eventType”: “TRANSPORT”,
“eventDateTime”: “2022-03-03T05:49:00-05:00”,
“eventCreatedDateTime”: “2022-03-14T10:40:52Z”,
“transportCall”: {
“facilityTypeCode”: “POTE”,
“modeOfTransport”: “VESSEL”,
“UNLocationCode”: “USEWR”
}
}
]
}

Extracting data should not be a problem as you are getting the output

The issue is related to the timezone and the below post may help in that issue.

Hello Rahul,

Thanks for your reply,

“Extracting data should not be a problem as you are getting the output” - Exactly what I am trying to understand. I am not using any convert activity or expressions. I am only using string variable here however it’s still auto converting the date-time. Below is the output I am expecting exactly as mentioned in JSON.

eventDateTime: 2022-02-19T07:12:00+01:00

Can you please help me with xmal to get this output?

Also, When I am trying to get the “eventCreatedDateTime” output is correct. The problem is only with the “eventDateTime” where there is an addition of hours in the ending

@loginerror

Could you maybe show your outputs @Tyson_Braganza?

I found this topic, as many people struggled with the same I guess:

You might need to do some extra steps to properly parse your string. It looks like it actually contains two datetime values in two different formats, which also complicates an issue.

Hi @Tyson_Braganza ,

The workaround can be used like adding some text to the datetime. In that case , it will be taken as string which can be later replaced to take only Datetime. But use this as last option.