The date command displays the current day, date, time, and year as well as it can set both the date and time for you. To see the current date and time, enter:
$ date
You must be login as root to set / change date under UNIX. The syntax to set date and time under UNIX and UNIX like operating system is as follows:
Where,
date MMddhhmm[[cc]yy]
- MM : Month (two-digit numeric month)
- dd : Day (two-digit numeric day i.e. day of month)
- hh : Hour
- mm : Minutes (30)
- cc : First two digits of the year (10)
- yy : Last two digits of the year (2010).
date 042708002010
HP-UX UNIX Set Date Example Using Various Formats
Using the mmddHHMM[[cc]yy][.ss] format, set date:Using the [[cc]yy]mmddHHMM[.ss] format:
date 010709342000
date 0107093400.00
date 010709342000.00
Using the mmddHHMM[.ss[[cc]yy]] format:
date 0001070934
date 200001070934
date 200001070934.00
date 01070934.0000
date 01070934.002000
IBM AIX UNIX Set Date
To set the date and time under AIX UNIX, enter:The above sets the date and time to Wed Feb 17 18:50:00 CST 2010.
date 0217185010
Getting Help About date Command
You can also view the manual page on date using the following command:$ man date
No comments:
Post a Comment