CCTZ time zone library for C++ from Google

FYI, last month, Google released and open-sourced cctz <https://github.com/google/cctz>, a new time zone library for C++. My favorite quote from the announcement <http://google-opensource.blogspot.com/2015/09/introducing-cctz-simple-time-z...> on their Open Source Blog:
*"Time zones are logical and easy to use." —no one ever*
-- Tim Parenti

On 2015-10-21 13:34, Tim Parenti wrote:
FYI, last month, Google released and open-sourced cctz <https://github.com/google/cctz>, a new time zone library for C++.
My favorite quote from the announcement <http://google-opensource.blogspot.com/2015/09/introducing-cctz-simple-time-z...> on their Open Source Blog:
/"Time zones are logical and easy to use." —no one ever/
Don't think that project will help much, as the zone is not part of the opaque structure, but is a separate parameter in their API: that won't cause many problems! ;^> If we think back 15+ years, many problems were due to messing around with sub-chunks of dates, whether string, integer, or bits, instead of using the APIs provided to convert from one date representation to another. Is it September again in the date/time domain? -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

Could be worse. Could be like the Boost date_time api, which somehow thought it would be acceptable to map tzdb identifiers to fixed offset pairs, and never even bothered to keep them updated.http://www.boost.org/doc/libs/1_59_0/doc/html/date_time/local_time.html#date... https://github.com/boostorg/date_time/tree/master/data T
To: tz@iana.org From: Brian.Inglis@systematicsw.ab.ca Date: Wed, 28 Oct 2015 09:52:32 -0600 Subject: Re: [tz] CCTZ time zone library for C++ from Google
On 2015-10-21 13:34, Tim Parenti wrote:
FYI, last month, Google released and open-sourced cctz <https://github.com/google/cctz>, a new time zone library for C++.
My favorite quote from the announcement <http://google-opensource.blogspot.com/2015/09/introducing-cctz-simple-time-z...> on their Open Source Blog:
/"Time zones are logical and easy to use." —no one ever/
Don't think that project will help much, as the zone is not part of the opaque structure, but is a separate parameter in their API: that won't cause many problems! ;^> If we think back 15+ years, many problems were due to messing around with sub-chunks of dates, whether string, integer, or bits, instead of using the APIs provided to convert from one date representation to another. Is it September again in the date/time domain?
-- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

I for one am happy to see progress made WRT time zone APIs in the C++ world. cctz may not be entirely comprehensive (like the new Java 8 date/time api, etc.) , but it does what it does quite well. From: mj1856@hotmail.com To: brian.inglis@systematicsw.ab.ca; tz@iana.org Subject: RE: [tz] CCTZ time zone library for C++ from Google Date: Wed, 28 Oct 2015 10:10:10 -0700 Could be worse. Could be like the Boost date_time api, which somehow thought it would be acceptable to map tzdb identifiers to fixed offset pairs, and never even bothered to keep them updated.http://www.boost.org/doc/libs/1_59_0/doc/html/date_time/local_time.html#date... https://github.com/boostorg/date_time/tree/master/data
To: tz@iana.org From: Brian.Inglis@systematicsw.ab.ca Date: Wed, 28 Oct 2015 09:52:32 -0600 Subject: Re: [tz] CCTZ time zone library for C++ from Google
On 2015-10-21 13:34, Tim Parenti wrote:
FYI, last month, Google released and open-sourced cctz <https://github.com/google/cctz>, a new time zone library for C++.
My favorite quote from the announcement <http://google-opensource.blogspot.com/2015/09/introducing-cctz-simple-time-z...> on their Open Source Blog:
/"Time zones are logical and easy to use." —no one ever/
Don't think that project will help much, as the zone is not part of the opaque structure, but is a separate parameter in their API: that won't cause many problems! ;^> If we think back 15+ years, many problems were due to messing around with sub-chunks of dates, whether string, integer, or bits, instead of using the APIs provided to convert from one date representation to another. Is it September again in the date/time domain?
-- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

If you're interested in keeping up with C++ APIs, check out ours as well: https://bloomberg.github.io/bde/group__baltzo.html It is built atop date/time types (John Lakos designed) in a lower package. bdlt::Datetime (no offset/tz), bdlt::DatetimeTz (datetime + offset), and baltzo::LocalDatetime (datetime + iana tz string) to cover all the use cases. The baltzo package allows efficient conversion from one timezone to another using these types. Included in the package is a default process-wide cache to help speed everything up. baltzo::TimeZoneUtil contains the high level conversion routines: https://bloomberg.github.io/bde/group__baltzo__timezoneutil.html Feedback always welcome :) On Wed, Oct 28, 2015 at 1:12 PM, Matt Johnson <mj1856@hotmail.com> wrote:
I for one am happy to see progress made WRT time zone APIs in the C++ world. cctz may not be entirely comprehensive (like the new Java 8 date/time api, etc.) , but it does what it does quite well.
------------------------------ From: mj1856@hotmail.com To: brian.inglis@systematicsw.ab.ca; tz@iana.org Subject: RE: [tz] CCTZ time zone library for C++ from Google Date: Wed, 28 Oct 2015 10:10:10 -0700
Could be worse. Could be like the Boost date_time api, which somehow thought it would be acceptable to map tzdb identifiers to fixed offset pairs, and never even bothered to keep them updated.
http://www.boost.org/doc/libs/1_59_0/doc/html/date_time/local_time.html#date... https://github.com/boostorg/date_time/tree/master/data
To: tz@iana.org From: Brian.Inglis@systematicsw.ab.ca Date: Wed, 28 Oct 2015 09:52:32 -0600 Subject: Re: [tz] CCTZ time zone library for C++ from Google
On 2015-10-21 13:34, Tim Parenti wrote:
FYI, last month, Google released and open-sourced cctz < https://github.com/google/cctz>, a new time zone library for C++.
My favorite quote from the announcement < http://google-opensource.blogspot.com/2015/09/introducing-cctz-simple-time-z...> on their Open Source Blog:
/"Time zones are logical and easy to use." —no one ever/
Don't think that project will help much, as the zone is not part of the opaque structure, but is a separate parameter in their API: that won't cause many problems! ;^> If we think back 15+ years, many problems were due to messing around with sub-chunks of dates, whether string, integer, or bits, instead of using the APIs provided to convert from one date representation to another. Is it September again in the date/time domain?
-- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

On Wed, Oct 28, 2015 at 4:09 PM, Andrew Paprocki <andrew@ishiboo.com> wrote:
If you're interested in keeping up with C++ APIs, check out ours as well: https://bloomberg.github.io/bde/group__baltzo.html
It is built atop date/time types (John Lakos designed) in a lower package. bdlt::Datetime (no offset/tz), bdlt::DatetimeTz (datetime + offset), and baltzo::LocalDatetime (datetime + iana tz string) to cover all the use cases. The baltzo package allows efficient conversion from one timezone to another using these types. Included in the package is a default process-wide cache to help speed everything up.
baltzo::TimeZoneUtil contains the high level conversion routines: https://bloomberg.github.io/bde/group__baltzo__timezoneutil.html
Feedback always welcome :)
As a point of comparison, cctz deals exclusively with *absolute time* (think time_t), *civil time* (think YMDhms), and *time zone* (opaque). So, there is no distinction between TimeZoneUtil's example 1, "Converting a UTC time to a Local Time", and example 2, "Converting a Local Time in One Time Zone to Another Time Zone." They are both instances of: at = MakeTime(ct1, tz1) ct2 = BreakTime(at, tz2) Notice also that "offset" does not appear anywhere in those concepts.

On Wed, Oct 28, 2015 at 1:12 PM, Matt Johnson <mj1856@hotmail.com> wrote:
I for one am happy to see progress made WRT time zone APIs in the C++ world. cctz may not be entirely comprehensive (like the new Java 8 date/time api, etc.) , but it does what it does quite well.
The cctz purveyors would content that the comprehensiveness of such interfaces fills a much needed gap! [Thanks Ken.]

Love the start and end date "rules" with subfields encoded and semicolon separated - explains why it has never been updated. Could perhaps have contributed a zic patch to add an output option and filter to generate this. Sig from: https://groups.google.com/forum/#!msg/sci.space.shuttle/L8-Upf8gZoY/NN6ngTI0... Those who do not understand Unix are | Henry Spencer @ U of Toronto Zoology condemned to reinvent it, poorly. | {allegra,ihnp4,decvax,utai}!utzoo!henry -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada On 2015-10-28 11:10, Matt Johnson wrote:
Could be worse. Could be like the Boost date_time api, which somehow thought it would be acceptable to map tzdb identifiers to fixed offset pairs, and never even bothered to keep them updated. http://www.boost.org/doc/libs/1_59_0/doc/html/date_time/local_time.html#date... https://github.com/boostorg/date_time/tree/master/data
T
To: tz@iana.org From: Brian.Inglis@systematicsw.ab.ca Date: Wed, 28 Oct 2015 09:52:32 -0600 Subject: Re: [tz] CCTZ time zone library for C++ from Google
On 2015-10-21 13:34, Tim Parenti wrote:
FYI, last month, Google released and open-sourced cctz <https://github.com/google/cctz>, a new time zone library for C++.
My favorite quote from the announcement <http://google-opensource.blogspot.com/2015/09/introducing-cctz-simple-time-z...> on their Open Source Blog:
/"Time zones are logical and easy to use." —no one ever/
Don't think that project will help much, as the zone is not part of the opaque structure, but is a separate parameter in their API: that won't cause many problems! ;^> If we think back 15+ years, many problems were due to messing around with sub-chunks of dates, whether string, integer, or bits, instead of using the APIs provided to convert from one date representation to another. Is it September again in the date/time domain?--

On Wed, Oct 28, 2015 at 11:52 AM, Brian Inglis < Brian.Inglis@systematicsw.ab.ca> wrote:
On 2015-10-21 13:34, Tim Parenti wrote:
FYI, last month, Google released and open-sourced cctz < https://github.com/google/cctz>, a new time zone library for C++.
My favorite quote from the announcement < http://google-opensource.blogspot.com/2015/09/introducing-cctz-simple-time-z...> on their Open Source Blog:
/"Time zones are logical and easy to use." —no one ever/
Don't think that project will help much, as the zone is not part of the opaque structure, but is a separate parameter in their API: that won't cause many problems! ;^>
I'm not sure what that means precisely, but I'm happy to discuss it. For what it's worth, at the conceptual level cctz is mostly just a C++ binding akin to TZ's newctime(3) functions. They both provide support for: civil_time = f(absolute_time, time_zone) absolute_time = g(civil_time, time_zone) In cctz, f() and g() are spelled BreakTime() and MakeTime() respectively. In TZ they are localtime_rz() and mktime_z().
If we think back 15+ years, many problems were due to messing around with sub-chunks of dates, whether string, integer, or bits, instead of using the APIs provided to convert from one date representation to another. Is it September again in the date/time domain?

On 10/21/2015 12:34 PM, Tim Parenti wrote:
FYI, last month, Google released and open-sourced cctz <https://github.com/google/cctz>
Thanks for the heads-up; I finally got around to installing the attached patch into the experimental version on Github.
participants (6)
-
Andrew Paprocki
-
Bradley White
-
Brian Inglis
-
Matt Johnson
-
Paul Eggert
-
Tim Parenti