Thursday, September 24, 2009

date command examples

% date
Thu Sep 24 22:29:09 JST 2009
%
% date '+%Y-%m-%d %H:%M:%S'
2009-09-24 22:29:15
%
% date -d '1 day ago' '+%Y-%m-%d %H:%M:%S'
2009-09-23 22:29:25
%
% date -d '2 months ago' '+%Y-%m-%d %H:%M:%S'
2009-07-24 22:29:33
%

No comments: