Diary/2009-8-19
経過秒を表現するとき
安易に考えて
sub min2 { my($p0) = @_; my($p8,$p9); if ($p0 > 31557600) { $p9 = int($p0 / 3155760) / 10 ; $p8 = "Year"; } elsif ($p0 > 2592000) { $p9 = int($p0 / 259200) / 10 ; $p8 = "Month"; } elsif ($p0 > 684800) { $p9 = int($p0 / 68480) / 10 ; $p8 = "weak"; } elsif ($p0 > 86400) { $p9 = int($p0 / 8640) / 10 ; $p8 = "Day"; } elsif ($p0 > 3600) { $p9 = int($p0 / 360) / 10 ; $p8 = "h"; } elsif ($p0 > 60) { $p9 = int($p0 / 6) / 10 ; $p8 = "m"; } else { $p9 = $p0 ; $p8 = "s"; } return "$p9"."$p8"; }
としてみた
☆
Today: 1 / Yesterday: 0