[threeten-dev] Era value

Stephen Colebourne scolebourne at joda.org
Wed Dec 5 02:43:08 PST 2012


On 5 December 2012 04:54,  <yoshito_umaoka at us.ibm.com> wrote:
> This is purely a question - not pointing out any issues in the spec.
>
> The Era#getValue() spec says:
>
> "The era in use at 1970-01-01 must have the value 1...."
>
> I'm wondering if this requirement is really necessary. In some calendar
> systems, there is only one era (well, conceptually, nothing before epoch).
> Of course, we could artificially invent post epoch era as era 0. Also,
> Japanese/Chinese dynasty eras could be over 100. If we use an era
> including 1970-01-01 as era 1, era value could ends up 3 digits negative
> value, which just look awkward.
>
> I was thinking about the reason behind this, but I could not see any
> convincing reasons. Can someone explain why this is a requirement?

This is simply a way to define values and provide some limitations to
implementors. We do define eras for points before the epoch of
calendar systems. To match the existing JDK, in Gregorian BC is 0 and
AD is 1. Thus it was effective to decare 1 as 1970 with lower numbers
for earlier.

We could remove this limitation, but I'm not sure I would change the
implementation.

Stephen


More information about the threeten-dev mailing list