Given:
DateTime.UtcNow
How do I get a string which represents the same value in an ISO 8601-compliant format?
Note that ISO 8601 de
DateTime.Now.ToString("yyyy-MM-dd'T'HH:mm:ss zzz");
DateTime.Now.ToString("O");
NOTE: Depending on the conversion you are doing on your end, you will be using the first line (most like it) or the second one.
Make sure to applied format only at local time, since "zzz" is the time zone information for UTC conversion.