in reply to Moon phase on historical events

Does this take into account historical changes of timezones and calendars?

Asking, because this can get quite messy and facepalm'y. Things like countries skipping a day (or even a few weeks) are quite a normal thing. As are things like "we change how or if we use daylight savings time whenever we change government".

Tom Scott has a video in Computerphile that shows how messy things can get.

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Replies are listed 'Best First'.
Re^2: Moon phase on historical events
by bliako (Abbot) on Oct 29, 2021 at 15:02 UTC

    Good point. The answer is I don't know, I assumed that DateTime would handle that. It seems there is something relevant here https://metacpan.org/pod/DateTime::TimeZone#$tz-%3Eoffset_for_datetime(-$dt-)

    Given a DateTime object, this method returns the offset in seconds for + the given datetime. This takes into account historical time zone inf +ormation, as well as Daylight Saving Time. The offset is determined b +y looking at the object's UTC Rata Die days and seconds.