DateTime::Event::Sunrise-question
Why does that script say that sunrise is at 04:11:20 - it should be dark night at this time. DateTime::Event::Sunrise
#!/usr/bin/env perl
use warnings;
use 5.012;
use DateTime;
use DateTime::Event::Sunrise;
my $dt = DateTime->new( year => 2010, month => 12, day => 22, time_zone => 'CET' );
my $sunrise_span = DateTime::Event::Sunrise ->new (
longitude => '48',
latitude =&开发者_如何转开发gt; '16',
altitude => '-0.833',
iteration => '1' );
my $both_times = $sunrise_span->sunrise_sunset_span( $dt );
say "Sunrise is: " , $both_times->start->datetime;
say "Sunset is: " , $both_times->end->datetime;
# Sunrise is: 2010-12-22T04:11:20
# Sunset is: 2010-12-22T15:22:01
The given times are absolutely correct, in Central Europe time, for the latitude and longitude you specified (which is in Yemen). Though Yemen is UTC+3, so in their local time, sunrise would be 6:11 and sunset 17:22.
Where did you intend to calculate sunrise and sunset for?
精彩评论