How can i convert ISO 8601 with timezone to c# actual (local) datetime format.
my ISO 8601 date is like "2016-06-19T19:30:43+04:30
"
and I need something like this "2016-06-19 16:00:43
"
How can i convert ISO 8601 with timezone to c# actual (local) datetime format.
my ISO 8601 date is like "2016-06-19T19:30:43+04:30
"
and I need something like this "2016-06-19 16:00:43
"
since W3c adopted ISO8601 you can use:
XmlConvert.ToString Method (DateTime, XmlDateTimeSerializationMode)
with the XmlDateTimeSerializationMode you can control how you want to date to be processed.
see https://msdn.microsoft.com/en-us/library/ms162344(v=vs.110).aspx
and there is the reverse method to convert string to date...
XmlConvert.ToDateTime Method (String, XmlDateTimeSerializationMode)
https://msdn.microsoft.com/en-us/library/ms162342(v=vs.110).aspx