Problems? Is your data what you think it is? | |
PerlMonks |
Trouble with time zones and Sun rise/setby GrandFather (Saint) |
on Apr 19, 2022 at 01:42 UTC ( [id://11143067]=perlquestion: print w/replies, xml ) | Need Help?? |
GrandFather has asked for the wisdom of the Perl Monks concerning the following question: I'm writing a script to generate a report of interesting astronomical events for a specified month. Mostly it's going very well, but I have struck a problem which I suspect is time zone related, but just can't make sense of. The script below is supposed to calculate Sun rise and set times as observed by a telescope in Wellington, New Zealand. Instead it seems to insist on generating UTC times even though the DateTime objects representing the rise and set times know that they are using 'Pacific/Auckland' time. Assuming the times are UTC, they are plausible. Can anyone see what I'm doing wrong or have misunderstood? (Yes, even in New Zealand in the Southern Hemisphere the sun rises before it sets on the same day.)
Prints:
Expected:
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Back to
Seekers of Perl Wisdom
|
|