Perlでの Timeの足し算
時間の足し算をやりたい。訳あってライブラリが使えません。
方法は無いでしょうか?
仮にライブラリが使えるなら、下記のようでうまく行っています。
---------------------------------------------------
use Time::Local;
$year=2008;
$mon =10;
$mday=24;
$hours = 23;
$min = 0;
$sec = 0;
$time = timelocal($sec, $min, $hours, $mday, $mon - 1, $year);
$a1=($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time );
$mytimeORG= sprintf("%04d/%02d/%02d %2d:%2d", $year + 1900, $mon +1, $mday,$hour,$min);
print "$mytimeORG\n";
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time + 32400); #9H加算
$mytime9H= sprintf("%04d/%02d/%02d %02d:%02d", $year + 1900, $mon +1, $mday,$hour,$min);
print "$mytime9H\n";
---------------------------------------------