Hi All,
The string output that I am getting via HTTP request is - “2024-05-23T11:30:56-07:00”
But when I am deserialising JSON to get a key value pair, this value is auto-converting to “2024-05-24T00:00:56+05:30” i.e the local timezone.
Is there a way to retain the original timezoneinfo?
lrtetala
(Lakshman Reddy)
May 31, 2024, 5:21am
2
Hi @Pranav_Kende
Can you try like below
TimeZoneInfo.ConvertTime(DateTimeOffset.Parse(jsonObject("date").ToString), TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time")).ToString("yyyy-MM-ddTHH:mm:sszzz")
Cheers!!
Here you have used FindSystemTimeZoneById(“Pacific Standard Time”) because it is -7:00.
Here, we cannot predict the timezone from the API. Now we can see -7:00, but also can be -6:00, -5:00 etc
ppr
(Peter Preuss)
May 31, 2024, 7:23am
4
you can use the Serialization Config Parameter and block the parsing
will not be changed when the serialization is configured as explained within the cross-referenced topic
system
(system)
Closed
June 12, 2024, 12:04pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.