Saturday, April 25, 2009
Monday, April 20, 2009
date Function
add 5 years/months/days/hours/minutes/seconds to current date/time
$ date +%Y%m%d%H%M%S; date --date "now +5 years" +%Y%m%d%H%M%S 20090420161628 20140420161628 $ date +%Y%m%d%H%M%S; date --date "now +5 months" +%Y%m%d%H%M%S 20090420161639 20090920161639 $ date +%Y%m%d%H%M%S; date --date "now +5 days" +%Y%m%d%H%M%S 20090420161646 20090425161646 $ date +%Y%m%d%H%M%S; date --date "now +5 hours" +%Y%m%d%H%M%S 20090420161654 20090420211654 $ date +%Y%m%d%H%M%S; date --date "now +5 minutes" +%Y%m%d%H%M%S 20090420161659 20090420162159 $ date +%Y%m%d%H%M%S; date --date "now +5 seconds" +%Y%m%d%H%M%S
subtract xxx to current date/time
$ date +%Y%m%d%H%M%S; date --date "now -5 years" +%Y%m%d%H%M%S 20090420161922 20240420161922 $ date +%Y%m%d%H%M%S; date --date "now -5 years -1 months" +"%Y/%m/%d %H:%M:%S" 20090420162122 2004/03/20 16:21:22
Posted by techgeek168 at 4:11 PM 0 comments
Labels: UnixBashVi
Subscribe to:
Posts (Atom)