[Mono-list] Xml validation problem with xsd, date and timezone

plaid cholbr1 at lsu.edu
Thu Feb 9 15:52:32 UTC 2012


What format are you using for datetime entries?

I use datetime information a lot in my own programs and I can tell you there
are almost always some weird issues in Microsoft .NET with these fields,
some by design, but a lot of times it's CultureInfo-related.

I seem to remember in most instances if you read in an XML file with
multiple datetime fields, it inevitably tries to apply every datetime field
to the same offset as the *first* datetime entry it reads in, for example.

Using time zone information will also try to make it adhere to Daylight
Savings Time standards on the machine it's running on.  A few years back
when Microsoft tried to start applying DST updates this caused a lot of
headache to this process, cause it depends on the Date being supplied as to
whether it would read in (for example) -06:00 (CST) as -6 or -5 depending on
which entry was read in first, etc.

I use (by default) yyyy-MM-dd-T-HH:mm:ss-ZZ:ZZ
i.e.

2012-02-09T00:00:00-06:00 would be today in CST in the US
2012-03-11T00:00:00-06:00 would be March 11, 2012 for the same
2012-03-12T00:00:00-05:00 would be March 12, 2012 for the same
etc.

Either way, as a work-around you can always (as per documentation) try using
full datetime entries and always use either 00:00 for time or 12:00 if you
want the date to always be the normalized *same date* as per the
documentation provided.

I haven't had any issues personally doing this between Mono and .NET *shrug*

-----
Ars Longa, Vita Brevis.
--
View this message in context: http://mono.1490590.n4.nabble.com/Xml-validation-problem-with-xsd-date-and-timezone-tp4372806p4373277.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list