denver
denver

Reputation: 3135

Default format of XML serialized DateTime

I am serializing a DateTime object using the DataContractSerializer class. I get the following output.

2013-05-21T10:50:23.5602265-04:00

What is the final component?

YYYY-MM-DDTHH:MM:SS.zzzzzzz-??:??

Thanks

Upvotes: 1

Views: 3101

Answers (2)

Lawrence
Lawrence

Reputation: 3297

If I write the C# code below, I get the current time in the same format as is described:

DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffffffK")

Upvotes: 1

Dave Michener
Dave Michener

Reputation: 1098

That is your time zone offset. Greenwich Mean Time - 4 hours.

Upvotes: 6

Related Questions