Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Moon phase on historical events

by cavac (Parson)
on Oct 29, 2021 at 14:23 UTC ( [id://11138214]=note: print w/replies, xml ) Need Help??


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 (Monsignor) 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138214]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found