Sunday, September 2 2007

取得昨天的日期

1.bash $TZ="UTC+16" date 2.php $yesterday=date('ymd',date('U')-3600*24); 3.perl perl -e 'print scalar localtime(time-3600*24)' Perl中取得日期格式的几种方法: perl -e 'use POSIX; print strftime("%Y-%m-%d %H:%M:%S", localtime)' perl -e 'use HTTP::Date;print HTTP::Date::time2iso(time);' perl -e  […]

Continue reading

Monday, October 30 2006

批量替换文件内容

find -type f | xargs perl -i -pe s%windows%linux%g  […]

Continue reading