- 243 名前:デフォルトの名無しさん mailto:sage [2013/08/10(土) 20:00:56.72 ]
- Time::Pieceを使う別解(レス節約)
# 30年後の日付を取得する方法 use Time::Piece; my($year,$month,$day) = (localtime)[5,4,3]; my $after30years = sprintf('%04d-%02d-%02d',1900+$year+30,$month+1,$day); # 1000日後の日付を取得する方法 use Time::Piece; my($year,$month,$day) = (localtime(time+1000*24*60*60))[5,4,3]; my $after1000days = sprintf('%04d-%02d-%02d',1900+$year,$month+1,$day);
|

|