Dave Rolsky wrote: > > On Wed, 24 Sep 2003, Flavio S. Glock wrote: > > > my $sunrise = DateTime::Event::Sunrise->sunrise ( > > longitude =>'-73.59', > > latitude =>'40.38', > > altitude => '-0.833', > > iteration => '1' > > )->set_time_zone( 'America/New_York' ); > > I really don't think we should make users do this if we can avoid. > > > my $rise = $sunrise->next($dt); > > print $rise->datetime, " ", $rise->time_zone_long_name, "\n"; > > This should probably set the returned datetime to the same timezone as the > given datetime.
How about this? sub _following_sunrise { [ ... initialize ...] my $tz = $dt->time_zone; my $loc = $dt->locale; [ ... some calculations ... ] $tmp_rise->set_time_zone( $tz ); # unless $tz->is_floating ??? $tmp_rise->set_locale( $loc ); return $tmp_rise; } - Flavio S. Glock