perl -e "print scalar(gmtime(1234567890))"使用perl转换unix时间
Fri Feb 13 23:31:30 2009
date +%s 获取当前时间戳
1397900749
utime(){ perl -e "print localtime($1).\"\n\"";}使用perl转换unixtime
$ utime
Sat Apr 19 18:50:26 2014
MIN=10;for ((i=MIN*60;i>=0;i--));do echo -ne "\r$(date -d"0+$i sec" +%H:%M:%S)";sleep 1;done倒计时
$ MIN=10;for ((i=MIN*60;i>=0;i--));do echo -ne "\r$(date -d"0+$i sec" +%H:%M:%S)";sleep 1;done
00:09:57
00:09:55
00:09:45
perl -lne ‘use POSIX; print strftime("%Y-%m-%d", localtime(time() - 86400));‘打印昨天日期
$ perl -lne ‘use POSIX; print strftime("%Y-%m-%d", localtime(time() - 86400));‘
2014-04-20
原文地址:http://www.cnblogs.com/lindasunflower/p/3738740.html