I am in need to pass value of type DateTime to an API in the below format
2018-12-02T07:00:00.000Z //required format
but the datetime value from Db I am getting is as
2018-10-25 05:30:00.0000000
Now using the .ToString("o")
, the value formatted as
2018-10-25T05:30:00.0000000
Checked below SO links
Where's the DateTime 'Z' format specifier?
http://stackoverflow.com/questions/9163977/converting-datetime-to-z-format
but not converting into the required format.
My understanding is having Z in the datetime represents UtcTimeZone.