2008년 2월 26일 화요일

perl date::format

use Time::Format qw(%time %strftime %manip);

$time{$format}
$time{$format, $unixtime}

print "Today is $time{'yyyy/mm/dd'}\n";
print "Yesterday was $time{'yyyy/mm/dd', time-24*60*60}\n";
print "The time is $time{'hh:mm:ss'}\n";
print "Another time is $time{'H:mm am tz', $another_time}\n";
print "Timestamp: $time{'yyyymmdd.hhmmss.mmm'}\n";


오늘
$end_date = $time{'yyyymmdd', time};
7일 전
$start_date = $time{'yyyymmdd', time-24*60*60*7};
 

댓글 없음:

댓글 쓰기