Please see below for an example of how to convert a date time to ISO 8601 format.
string isoFormatDateString = dateTimeObject.ToUniversalTime().ToString("s") + "Z";
Visit the DevX Tip Bank