[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XML Schema and Timezones


xml schema timezone
I am writing a Windows Scheduling Service in C# that will use data in XML
format to determine Scheduling information. This same file will be
replicated globally and hence will be subject to timezone changes and
daylight saving time.

[my timezone values are just examples - they may not be correct!!]

I was originally using the XSD dateTime data type to determine the date and
time to perform a task, but this is limited when applied globally, because
the offset (timezone) is based on local time and as soon as you replicate to
some other timezone, the local time changes and so your scheduling
information goes nuts.

An example...

We have a Scheduled item that is to be done on July 16th, 2002 at 2PM
Scottish time.
This is simple to express as July 16th, 2002 at 2PM GMT (summer has no
daylight saving time).
According to the XML Schema stanard
(http://www.w3.org/TR/xmlschema-2/#dateTime) which uses the format
"CCYY:MM:DDTHH:MM:SSZ"
this could be written as :
"2002:07:16T14:00:00Z"

However, this standard format doesn't work too great because in the winter
the local time in Scotland changes to 1 hour less than UTC and so the
scheduled time should change to "2002:07:16T13:00Z" or 1PM GMT, but how do
you know this from the above fomat? Sure, it tells you the date, so you can
work out whether Daylight Saving Time applies, but you don't know what
timezone it refers to - it is a bad mistake to assume the local timezone,
because if i moved the Schedule information to Santiago, Chile and we
assumed the local settings to determine the offset then on that date the UTC
time would be "2002:07:16T08:00Z" - because here we are 8 hours behind GMT
on that date.

There needs to be some way of stating the target timezone so that the
correct Daylight settings relative to UTC can be resolved. Something like
this...

"CCYY:MM:DDTHH:MM:SSZGXXXX"

where at the end, GXXXX specifies the locale identifier of the originally
scheduled time.

Does that make any sense?? Has there been talk of this before... 

I never really thought much about it until i had to use it in my app!!

Cheers,
Steven
Author "XML Application Development with MSXML 4.0"
www.deltabis.com


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.