On Mon, Mar 2, 2009 at 6:39 PM, Adam Vartanian <flo...@google.com> wrote: >> I'm having trouble coming up with a good approach to take here. The >> main issue is daylight savings time. It's fairly trivial for me to >> write a Java program that builds a list of timezone ID's and their >> associated GMT offsets, and using that list to give the C++ >> application the info it needs for the conversion, but I have not been >> able to come up with a good way to support daylight savings time (and >> also to support the dst-adjusted display names of timezones, e.g. >> "EST" vs "EDT" for EST5EDT) in the C++ application short of >> reimplementing all of the logic for every timezone ID by hand -- which >> is less than ideal. >> >> I realize this may be slightly off topic, but it is related to Joda. >> Apologies if this is the wrong place to ask... but I have not been >> able to come up with any solutions. Has anybody here ever done >> anything like this, or does anybody have any ideas about a good way to >> add Joda timezone ID support to non-Java applications? Ideally I'd >> like to support most of the Joda timezone IDs (both generic IDs like >> "EST5EDT" and city IDs like "America/New_York"), but I would be >> willing to limit the Java application to a representative subset of >> the IDs if that makes it easier to deal with on the C++ side of >> things. Any suggestions would be greatly appreciated. > > The timezone IDs aren't actually Joda-specific, they're ids from the > public domain tz database. See http://www.twinsun.com/tz/tz-link.htm. > They also provide a C library for accessing the timezone data, and > the same database backs most standard time implementations (such as > GNU libc's). As long as you use the same version of the data file in > both Joda-Time and whatever other library you choose, they should work > fine together. (Not using the same version just opens you up to > displaying the same instant differently in the different programs > since the definition of daylight savings time may have changed for > some geographies in between the versions, of course.)
Awesome; thanks a lot. Working from there, it also turns out that boost has a date/time package based off the same database (here's the link if anybody is curious): http://www.boost.org/doc/libs/1_38_0/doc/html/date_time/local_time.html#date_time.local_time.tz_database This is exactly what I wanted, and it's all already implemented. I don't get to pick the version; I'll have to do a little more research to see what rules changed and make note of it, but this should work fine. Thanks again, Jason ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Joda-interest mailing list Joda-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/joda-interest