Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use strict; use DateTime; use Data::Dumper; my @times = qw( 1176992127 1177011950 1177035464 1177059040 1177063718 + 1177074117 1177100432 1177135347 1177165344 1177193537 1177202407 11 +77222982 1177224344 1177271548 1177280164 1177290568 1177320406 11773 +69446 1177392779 1177418018 1177424739 1177450967 1177459364 11774883 +49 1177506719 1177533725 1177544267 1177554850 1177596791 ); my %date_count; foreach my $time (@times) { my $dt = DateTime->from_epoch( epoch => $time ); $date_count{$dt->year}->{$dt->month}->{$dt->day}->{$dt->hour}+ ++; } print Dumper \%date_count; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Split date ranges/chunks based on Unix epoch time?
by ikegami (Patriarch) on Apr 26, 2007 at 03:42 UTC | |
|
Re: Split date ranges/chunks based on Unix epoch time?
by GrandFather (Saint) on Apr 26, 2007 at 04:03 UTC | |
|
Re: Split date ranges/chunks based on Unix epoch time?
by jwkrahn (Abbot) on Apr 26, 2007 at 05:54 UTC | |
by Krambambuli (Curate) on Apr 26, 2007 at 06:47 UTC | |
by jwkrahn (Abbot) on Apr 26, 2007 at 14:13 UTC | |
by ikegami (Patriarch) on Apr 26, 2007 at 21:02 UTC | |
|
Re: Split date ranges/chunks based on Unix epoch time?
by Anonymous Monk on Apr 26, 2007 at 04:51 UTC | |
|
Re: Split date ranges/chunks based on Unix epoch time?
by Anonymous Monk on Apr 26, 2007 at 03:14 UTC |