How to convert DateTime objects to Python-friendly ISO8601 strings in C#

(and deserializing them in C# as well)

--

Photo by SHAHBAZ ZAMAN

A while ago my team needed a way to convert C# DateTime objects into strings that Python’s datetime module could parse. Everything else was in ISO8601 format, so for consistency’s sake this needed to be as well.

--

--

Adam Fisher / fisher king (@therightstuff)

Software developer and writer of words, currently producing a graphic novel adaptation of Shakespeare's Sonnets! See http://therightstuff.bio.link for details.