jesuashok has asked for the wisdom of the Perl Monks concerning the following question:
I have subroutine which gets two params
PARAM1 -> <time_stamp> Ex:200504250946
PARAM2 -> <interval> Ex:15 || 30 only
The function has to extract the minutes from time_stamp (i,e) substr("200504250946",10,2) which results '46' from the example.%normalise_with_this = ( 15 => { 00 => [ 0 .. 14 ], 15 => [ 15 .. 29 ], 30 => [ 30 .. 44 ], 45 => [ 45 .. 59 ] }; 30 => { 00 => [ 0 .. 29 ], 30 => [ 30 .. 59 ] }; );
2006-04-25 Retitled by holli, as per Monastery guidelines
Original title: 'Ideas requested from all monks members'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Round time to nearest 15 or 30 minutes
by atcroft (Abbot) on Apr 25, 2006 at 03:52 UTC | |
by jesuashok (Curate) on Apr 25, 2006 at 04:02 UTC | |
by DrHyde (Prior) on Apr 25, 2006 at 10:05 UTC | |
by bill_mcgonigle (Acolyte) on May 18, 2010 at 01:04 UTC | |
|
Re: Round time to nearest 15 or 30 minutes
by l.frankline (Hermit) on Apr 25, 2006 at 04:41 UTC |