On Mon, 02 May 2011 11:46:42 -0500, Matt wrote:
> Have a date:
>
> 2011-05-02-16:40:51
[...]
>
> I need to round it to nearest 5 minute point.
>
> 2011-05-02-16:40:51
If you care about things like daylight savings time adjustments, calendar
changes, or leap seconds, the answer requires consid
On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote:
Have a date:
2011-05-02-16:40:51
Using this to get it:
$tm = gmtime;
$time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d",
$tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec;
print "$time_stamp\n";
I need to r
On 04/05/2011 18:14, C.DeRykus wrote:
On May 3, 4:12 pm, rob.di...@gmx.com (Rob Dixon) wrote:
On 03/05/2011 19:49, C.DeRykus wrote:
use Time::localtime;
use List::Util qw/reduce/;
my @rounded_5mins = grep { not $_ % 5 } 0..60;
my $curr_min = localtime->min;
my $round_min = reduce { $curr_mi
On May 3, 4:12 pm, rob.di...@gmx.com (Rob Dixon) wrote:
> On 03/05/2011 19:49, C.DeRykus wrote:
>
>
>
>
>
>
>
>
>
> > On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote:
> >> Have a date:
>
> >> 2011-05-02-16:40:51
>
> >> Using this to get it:
>
> >> $tm = gmtime;
> >> $time_stamp = sprintf "%04d-%02
On 03/05/2011 19:49, C.DeRykus wrote:
On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote:
Have a date:
2011-05-02-16:40:51
Using this to get it:
$tm = gmtime;
$time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d",
$tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec;
print
On May 3, 11:54 am, shawnhco...@ncf.ca (Shawn H Corey) wrote:
> On 11-05-03 02:49 PM, C.DeRykus wrote:
>
> > my @rounded_5mins = grep { not $_ % 5 } 0..60;
>
> my @rounded_5mins = map { $_ * 5 } 0..12;
>
> # TIMTOWTDI
>
Make that: TIMTOWTDI++ # a much better way to do it
--
Charles DeRykus
-
On 11-05-03 02:49 PM, C.DeRykus wrote:
my @rounded_5mins = grep { not $_ % 5 } 0..60;
my @rounded_5mins = map { $_ * 5 } 0..12;
# TIMTOWTDI
--
Just my 0.0002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Programming is as much about organization and commu
On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote:
> Have a date:
>
> 2011-05-02-16:40:51
>
> Using this to get it:
>
> $tm = gmtime;
> $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d",
> $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec;
> print "$time_stamp\n";
>
> I n
On 02/05/2011 17:46, Matt wrote:
Have a date:
2011-05-02-16:40:51
Using this to get it:
$tm = gmtime;
$time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d",
$tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec;
print "$time_stamp\n";
I need to round it to nearest 5 minut
On 5/2/11 Mon May 2, 2011 9:46 AM, "Matt" scribbled:
> Have a date:
>
> 2011-05-02-16:40:51
>
> Using this to get it:
>
> $tm = gmtime;
> $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d",
> $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec;
> print "$time_stamp\n
> "M" == Matt writes:
M> Have a date:
M> 2011-05-02-16:40:51
M> Using this to get it:
M> $tm = gmtime;
M> $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d",
M> $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec;
M> print "$time_stamp\n";
use POSIX
Have a date:
2011-05-02-16:40:51
Using this to get it:
$tm = gmtime;
$time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d",
$tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec;
print "$time_stamp\n";
I need to round it to nearest 5 minute point.
2011-05-02-16:40:51
needs
12 matches
Mail list logo