comp.org.uk

Networking | Programming | Security | Linux | Computer Science | About

Display Future Date and Time in Linux

The following examples shows how to display a future date and time on the Linux command line:

$ date Thu Jan 1 08:30:07 PST 2009 
$ date —date=‘3 seconds’ Thu Jan 1 08:30:12 PST 2009 
$ date —date=‘4 hours’ Thu Jan 1 12:30:17 PST 2009 
$ date —date=‘tomorrow’ Fri Jan 2 08:30:25 PST 2009 
$ date —date=“1 day” Fri Jan 2 08:30:31 PST 2009 
$ date —date=“1 days” Fri Jan 2 08:30:38 PST 2009 
$ date —date=“2 days” Sat Jan 3 08:30:43 PST 2009 
$ date —date=‘1 month’ Sun Feb 1 08:30:48 PST 2009 
$ date —date=‘1 week’ Thu Jan 8 08:30:53 PST 2009 
$ date —date=“2 months” Sun Mar 1 08:30:58 PST 2009 
$ date —date=“2 years” Sat Jan 1 08:31:03 PST 2011 
$ date —date=“next day” Fri Jan 2 08:31:10 PST 2009 22

Published on Fri 15 March 2002 by Craig Brown in Linux with tag(s): date linux