while ( my $dt = $it->next() ) { print $dt->datetime(), "\n" if ($dt->hour > 6 and $dt->hour < 23); }