Chronology Key Calculator

Encode and decode historical dates (BC/AD) into sortable keys for the Aramean Library.

Encode a date → key

Decode a key → date

Sorting logic: astronomical year blocks ensure BC→AD ordering;
Key = yAstr × 10000 + month × 100 + day, where yAstr = (BC ? −(year−1) : year)