Date command

From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to: navigation, search
  • The date command displays the current date and time.
  • You can set the system date and time.
  • When invoked without arguments, the date command displays the current date and time on stdout (screen).
date

Sample outputs:

Sat Sep 26 13:58:27 IST 2009

Set the date

  • Only the superuser may set the date.
  • Invalid dates like 29-02-2003 (dd-mm-yyyy) or times like 24:00 are rejected.

External links