Chinaunix

标题: 有什么办法知道当前距离某一时间多少秒? [打印本页]

作者: tong1125    时间: 2006-07-12 11:00
标题: 有什么办法知道当前距离某一时间多少秒?
譬如我想知道2005-01-01距离现在多少秒应该怎么算?
作者: waker    时间: 2006-07-12 11:05
echo $(($(date +%s)-$(date +%s -d '2005-01-01')))

请用Great Gnu date
作者: tong1125    时间: 2006-07-12 11:30
原帖由 waker 于 2006-7-12 11:05 发表
echo $(($(date +%s)-$(date +%s -d '2005-01-01')))

请用Great Gnu date


如果是在AIX环境下面应该怎么写呀?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2