Time::Piece::Over24 - Adds over 24:00:00 methods to Time::Piece
use Time::Piece::Over24; my $t = localtime; #e.g. 2011-01-01 04:00:00 now $t->over24_offset("05:00:00"); #method changed!! time >>> datetime print $t->over24_datetime; >2010-12-31 28:00:00 print $t->over24_time; >28:00:00 print $t->over24_year; >2010 print $t->over24_mon; >12 print $t->over24_mday; >31 print $t->over24_hour; >28; #e.g. today is 2011-01-01 #retun Time::Piece object my $over_time = $t->from_over24_time("26:00:00"); my $over_datetime = $t->from_over24_datetime("2011-01-01 26:00:00"); print $over_time->datetime; print $over_datetime->datetime; >2011-01-02 02:00:00 #over24 is alias over24_time and from_over24_time and from_over24_datetime $t->over24(); #call over24_time; $t->over24("26:00:00"); #call from_over24_time $t->over24("2011-01-01 26:00:00"); #call from_over24_datetime print $t->is_during("2010-12-31 23:00:00","2011-01-01 10:00:00"); >1 print $t->is_during("2011-01-01 05:00:00","2011-01-01 10:00:00"); >Use of uninitialized value in print ... = retrun value is undef!
start hour a day.
default "00:00:00".
value is undef, return offset time.
print localtime->over24_offset();
>00:00:00
not undef is set offset time.
value format is "5" or "05" or "05:00" or "05:00:00", every format is ok.
but set value range is [00:00:00 - 23:59:59]
e.g. over24_offset("05:00:00"); #hour range is [05:00:00 - 28:59:59]
e.g. over24_offset("11:00:00"); #hour range is [11:00:00 - 34:59:59]
get datetime in offset time
return a Time::Piece object.
*not null over24_time e.g.over24_time("26:00:00") is alias, from_over24_time
*not null over24_datetime e.g.over24_datetime("26:00:00") is alias, from_over24_datetime
return 1 or undef
check a time
is_during("start_time","end_time","check_time");
check_time is option.default is now.
start_time and end_time format is datetime,time and timepiece object.
plz start and end is same format.
Synsuke Fujishiro <i47.rozary at gmail.com>
(c) 2011, Synsuke Fujishiro.All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Time::Piece, Time::Piece::MySQL
To install Time::Piece::Over24, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Time::Piece::Over24
CPAN shell
perl -MCPAN -e shell install Time::Piece::Over24
For more information on module installation, please visit the detailed CPAN module installation guide.