Does cctz use astronomical year numbering?

13 views
Skip to first unread message

Susanne Meyer

unread,
Jun 4, 2019, 10:18:40 AM6/4/19
to cctz
Hi there!

Is it true that cctz uses astronomical year numbering (negativ year values) for dates before christ?

For example "Western Christian Era" date: 10. July 20 BC =
Day = 10;
Month = 7;
Year = -19; (negativ number)

When converting from "Local Time" to "UTC" and vice versa I noticed that cctz::civil_second(..) accepts dates with year = 0 or even negativ year numbers. There's also no BC and AD parameter for years before and after the birth of christ.

For example for "UTC" to "Local Time" conversion:

cctz::time_zone tz_local;
cctz::load_time_zone("Europe/Paris", &tz_local);
const auto timepoint = cctz::convert(cctz::civil_second(-19, 7, 10, 12, 0, 0), tz_local); // year = -19 valid, no error message
const auto bl = tz_utc.lookup(timepoint);
UTC_Year = bl.cs.year(); // Result UTC_Year = -19;

So I suppose cctz is calculating with astronomical year numbering and the user has to convert cctz dates to "Western Christian Era" year numbering. Is that correct?

I ask this question to verify that I use and understand cctz correctly.

Best regards,
Susanne

Bradley White

unread,
Jun 4, 2019, 3:26:20 PM6/4/19
to Susanne Meyer, cctz
Hi Susanne,

For civil times, CCTZ uses the proleptic Gregorian calendar and represents years as simple integers.

So, year 0 is the year before year 1, and year -1 is the year before year 0.

If you want to use any other calendar or year-numbering system you will have to do the conversions yourself.

Bradley
Reply all
Reply to author
Forward
0 new messages