-----Original Message----- From: Stephen Turner [mailto:sturner@clicktracks.com] Sent: 22 December 2006 16:39 To: 'boost-users@lists.boost.org' Subject: [date_time] timezone rules for different years
For my application, I need to be able to get the local time of any UTC time in the last five years in any location.
As far as I can see, the date_time library doesn't provide this. The documentation says that date_time_zonespec.csv is "based on data found in the zoneinfo datebase", but whereas the zoneinfo database contains historical information about daylight saving time changes, date_time_zonespec.csv only seems to allow you to specify a single rule for each timezone. And I can't find another mechanism to do it.
Am I missing something, or is this capability not present? And if not, is there any plan to add it? Or a workaround? I anticipate that this will become more of a problem when the rules for the U.S. change by several weeks next year.
I'm not sure whether this one got lost in the holiday break, or whether there's nobody who's familiar with the internals of this library on this list, but let me try again. I've been trying to work out how to add the capability to have different timezone rules in different years to the library. It seems to me it's not too hard (although I'm nervous of making such a judgement in code I'm not familiar with). I think all that's needed is: 1) In class custom_time_zone, the rules should depend on y, rather than there just being one set of rules. 2) The date_time_zonespec.csv file would have to have extra columns for years a rule applied to. tz_db_base::parse_string would have to parse them, and instead of creating a new timezone for each line, add the rule to the appropriate timezone if it had already been seen once. Is there anything else that would need to be done? Actually, I think the hardest part would be populating the date_time_zonespec.csv file. Is there already a program to generate that file from the zoneinfo files, or was it done semi-by-hand? Thanks, -- Stephen Turner, Cambridge, UK http://homepage.ntlworld.com/adelie/stephen/ "The internet is a reflection of our society. If we do not like what we see, the problem is not to fix the mirror, we have to fix society." (Vint Cerf)