# Ada package for dates prior to 1900?

**URL:** <https://forum.ada-lang.io/t/ada-package-for-dates-prior-to-1900/596>\
**Category:** General\
**Created:** [December 18, 2023, 3:11am UTC](https://forum.ada-lang.io/t/ada-package-for-dates-prior-to-1900/596 "2023-12-18T03:11:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ret\_Build\_Engineer](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/r/ccd318/32.png) [@Ret\_Build\_Engineer](https://forum.ada-lang.io/u/Ret_Build_Engineer)\
**Post date:** [December 18, 2023, 3:11am UTC](https://forum.ada-lang.io/t/ada-package-for-dates-prior-to-1900/596/1 "2023-12-18T03:11:31Z")

</div>

Hi;

How does one do calendar, date and time, calculations in Ada if the dates are prior to 1900? I’m sure that this is a real problem that has been encountered previously. I’ve never seen anything that does this. Do people just make a foreign call to Perl or UNIX cal program?

Thanks,  
Ken Wolcott

---

<div class="post-metadata">

**Author:** ![JeremyGrosser](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/jeremygrosser/32/3_2.png) [@JeremyGrosser](https://forum.ada-lang.io/u/JeremyGrosser)\
**Post date:** [December 18, 2023, 4:10am UTC](https://forum.ada-lang.io/t/ada-package-for-dates-prior-to-1900/596/2 "2023-12-18T04:10:07Z")

</div>

The Matreshka League library looks like it has fairly comprehensive support for date/time operations using a base time in 1582 AD.

> <https://github.com/godunko/matreshka/blob/39f896135df653999895eeca8420b7cfdc1da89c/source/league/matreshka-internals-calendars.ads#L55>

Generally speaking, if you’re regularly working with dates prior to January 1, 1970, you should consider parsing the “backzone” file from the [tzdata distribution](https://www.iana.org/time-zones) and doing the math yourself rather than relying on a library. There are a lot of cases that are open to interpretation depending on your project’s goals. The comments in backzone may be helpful context.

---

<div class="post-metadata">

**Author:** ![JC001](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@JC001](https://forum.ada-lang.io/u/JC001)\
**Post date:** [December 18, 2023, 1:30pm UTC](https://forum.ada-lang.io/t/ada-package-for-dates-prior-to-1900/596/3 "2023-12-18T13:30:45Z")

</div>

What operations do you need?

---

<div class="post-metadata">

**Author:** ![Ret\_Build\_Engineer](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/r/ccd318/32.png) [@Ret\_Build\_Engineer](https://forum.ada-lang.io/u/Ret_Build_Engineer)\
**Post date:** [December 18, 2023, 11:36pm UTC](https://forum.ada-lang.io/t/ada-package-for-dates-prior-to-1900/596/4 "2023-12-18T23:36:43Z")

</div>

Hi;

I’lol take a look at the Matreshka League library.

No need at all; just significant curiosity that such a thing didn’t (apparently) exist.

Thanks,  
Ken

---

<div class="post-metadata">

**Author:** ![JC001](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@JC001](https://forum.ada-lang.io/u/JC001)\
**Post date:** [December 19, 2023, 11:21pm UTC](https://forum.ada-lang.io/t/ada-package-for-dates-prior-to-1900/596/5 "2023-12-19T23:21:50Z")

</div>

> [@Ret\_Build\_Engineer](#):
>
> No need at all; just significant curiosity that such a thing didn’t (apparently) exist.

[`PragmARC.Date_Handler`](https://github.com/jrcarter/PragmARC) can do formatting, day-of-week, leap-year, and days-in-month for any year CE in Positive, if that’s of any interest.
