devxlogo

August 1, 2019

Convert a Date to ISO 8601 Format in C#

Please see below for an example of how to convert a date time to ISO 8601 format. string isoFormatDateString = dateTimeObject.ToUniversalTime().ToString(“s”) + “Z”;