Some questions about the database format
Hi, I intend to use the tz database in my C# calendar application. Since I need a decent time zone support, I was pointed to this database from the MSDN forums. I now have a few questions regarding the file format of the text files. A day specification of "Sun>=1" or "Sun>=8" should be clear, I interpret this as the first/second Sunday in a month. But what weekday and week is "Sun>=25" or "Sun>=2"? How is the Zone field "[UNTIL]" to be understood exactly? Is it including or excluding the given time? What does "1990" mean, is it until and inclusive the whole year 1990, ie /1990-12-31T23:59:59 or is it something around 1990-01-01? What does the time specification "2:00s" mean? I've seen it several times but couldn't make any sense of it. Are all rules in the text files sorted ascending by time ("FROM" year)? That would simplify the processing because in order to convert them into .NET framework structures I need pairs of DST start and end rules together for a range of years, and thus need to resolve the overlapping rule definitions.
I intend to use the tz database in my C# calendar application. Since I need a decent time zone support, I was pointed to this database from the MSDN forums. I now have a few questions regarding the file format of the text files.
A day specification of "Sun>=1" or "Sun>=8" should be clear, I interpret this as the first/second Sunday in a month. But what weekday and week is "Sun>=25" or "Sun>=2"?
both of those are still Weekday == Sunday It is "the first Sunday on or after the 25th day of the month" or "the first Sunday on or after the 2nd day of the month" The first entry might be used for "the last Sunday of a 31-day month"
How is the Zone field "[UNTIL]" to be understood exactly? Is it including or excluding the given time? What does "1990" mean, is it until and inclusive the whole year 1990, ie /1990-12-31T23:59:59 or is it something around 1990-01-01?
What does the time specification "2:00s" mean? I've seen it several times but couldn't make any sense of it.
The 's' suffix means that the transition between standard time and savings/summer time occurs at 2:00 AM standard time. A "spring forward" would jump from 2:00 AM standard to 3:00 AM summer; a "fall back" would jump from 3:00 AM summer back to 2:00 AM standard.
Are all rules in the text files sorted ascending by time ("FROM" year)? That would simplify the processing because in order to convert them into .NET framework structures I need pairs of DST start and end rules together for a range of years, and thus need to resolve the overlapping rule definitions.
Yves Goergen <nospam.list@unclassified.de> wrote on 06/29/2010 09:27:01 AM:
Hi,
I intend to use the tz database in my C# calendar application. Since I need a decent time zone support, I was pointed to this database from the MSDN forums. I now have a few questions regarding the file format of the text files.
A day specification of "Sun>=1" or "Sun>=8" should be clear, I interpret this as the first/second Sunday in a month. But what weekday and week is "Sun>=25" or "Sun>=2"?
How is the Zone field "[UNTIL]" to be understood exactly? Is it including or excluding the given time? What does "1990" mean, is it until and inclusive the whole year 1990, ie /1990-12-31T23:59:59 or is it something around 1990-01-01?
What does the time specification "2:00s" mean? I've seen it several times but couldn't make any sense of it.
These are well defined in the man page of zic. Download tzcodeC.tar.gz (C is a version such as 2010j) from ftp://elsie.nci.nih.gov/pub/ and read docs included in the distribution.
Are all rules in the text files sorted ascending by time ("FROM" year)? That would simplify the processing because in order to convert them into .NET framework structures I need pairs of DST start and end rules
together
for a range of years, and thus need to resolve the overlapping rule definitions.
Strictly speaking, you cannot expect DST start and end are always paired within a single year. Also, some rules used by the tzdatabasemight not be directly mapped to Windows/.NET style rule. I'm working for ICU project ( http://icu-project.org/) and implemented a time zone API which extracts DST start/end rules around the given time in Windows/iCalendar style rule format: C++ http://icu-project.org/apiref/icu4c/classBasicTimeZone.html#8ec554fc7301450d... Java http://www.icu-project.org/apiref/icu4j/com/ibm/icu/util/BasicTimeZone.html#... -Yoshito
There is also a c# API implementation at http://www.codeproject.com/KB/locale/zoneinfo_dotnet_api.aspx Cheers Lee -------- Those who sacrifice liberty for security deserve neither -- Benjamin Franklin On 29 June 2010 15:11, <yoshito_umaoka@us.ibm.com> wrote:
Yves Goergen <nospam.list@unclassified.de> wrote on 06/29/2010 09:27:01 AM:
Hi,
I intend to use the tz database in my C# calendar application. Since I need a decent time zone support, I was pointed to this database from the MSDN forums. I now have a few questions regarding the file format of the text files.
A day specification of "Sun>=1" or "Sun>=8" should be clear, I interpret this as the first/second Sunday in a month. But what weekday and week is "Sun>=25" or "Sun>=2"?
How is the Zone field "[UNTIL]" to be understood exactly? Is it including or excluding the given time? What does "1990" mean, is it until and inclusive the whole year 1990, ie /1990-12-31T23:59:59 or is it something around 1990-01-01?
What does the time specification "2:00s" mean? I've seen it several times but couldn't make any sense of it.
These are well defined in the man page of zic. Download tzcodeC.tar.gz (C is a version such as 2010j) from ftp://elsie.nci.nih.gov/pub/ and read docs included in the distribution.
Are all rules in the text files sorted ascending by time ("FROM" year)? That would simplify the processing because in order to convert them into .NET framework structures I need pairs of DST start and end rules
together
for a range of years, and thus need to resolve the overlapping rule definitions.
Strictly speaking, you cannot expect DST start and end are always paired within a single year. Also, some rules used by the tzdatabasemight not be directly mapped to Windows/.NET style rule. I'm working for ICU project ( http://icu-project.org/) and implemented a time zone API which extracts DST start/end rules around the given time in Windows/iCalendar style rule format:
C++
http://icu-project.org/apiref/icu4c/classBasicTimeZone.html#8ec554fc7301450d... Java
http://www.icu-project.org/apiref/icu4j/com/ibm/icu/util/BasicTimeZone.html#...
-Yoshito
On 29/06/10 15:59, Lee Baker wrote:
There is also a c# API implementation at http://www.codeproject.com/KB/locale/zoneinfo_dotnet_api.aspx
And perhaps the noda-time project (mentioned on the list about a week ago) would be of interest: http://code.google.com/p/noda-time/
On 29.06.2010 16:11 CE(S)T, yoshito_umaoka@us.ibm.com wrote:
These are well defined in the man page of zic. Download tzcodeC.tar.gz (C is a version such as 2010j) from ftp://elsie.nci.nih.gov/pub/ and read docs included in the distribution.
Thank you. That's indeed a very complete definition of the files. I just didn't see it at first.
Strictly speaking, you cannot expect DST start and end are always paired within a single year. Also, some rules used by the tzdatabasemight not be directly mapped to Windows/.NET style rule.
I see. I have already found definitions of double daylight saving times and other weird stuff. So I've dropped my hope to use TimeZoneInfo and am now going to use custom data structures and algorithms to use the data. (See other thread.) -- Yves Goergen "LonelyPixel" <nospam.list@unclassified.de> Visit my web laboratory at http://beta.unclassified.de
participants (5)
-
Ian Abbott -
Lee Baker -
Paul Goyette -
yoshito_umaoka@us.ibm.com -
Yves Goergen