Change time method under linux introduce

  
modify linux time can use date command date command function is to display and set system date and time. Enter date to view the current system time. The modification time requires date - the function of the character modification. The meaning of each option in the command is: -d datestr, --date datestr displays the date described by datestr -s datestr, --set datestr sets the date described by datestr -u, -- Universal Displays or sets the universal time domain %H hours (00..23)%I hours (01..12)%k hours (0..23)%l hours (1..12)%M points (00. .59)%p shows AM or PM%r time (hh:mm:ss AM or PM), 12 hours %s from January 1, 1970 00:00:00 to the current number of seconds %S ( 00..59)%T time (24-hour clock) (hh:mm:ss)%X Display time format (%H:%M:%S)%Z Time zone date field %a Short for the day of the week (Sun. .Sat)%A Full name of the day of the week (Sunday..Saturday) Abbreviation for the month of January (Jan..Dec) Full name of the month of January (January..December)%c Date and time (Mon Nov 8 14:12: 46 CST 1999)%d Day of the month (01..31)%D Date (mm/dd/yy)%h and %b options are the same %j Day of the year (001..366)% m Month (01..12)%w Day of the week (0 for Sunday)%W Year of the year A few weeks (00..53, Monday is the first day)%x shows the format of the date (mm/dd/yy)%y The last two digits of the year (1999 is 99)%Y years (for example: 1970 , 1996, etc.) It is important to note that only the superuser can set the time with the date command. The general user can only display the time with the date command. Example 1: Display the time in the specified format. $ date '+This date now is =>%x ,time is now =>%X ,thank you !'This date now is =>11/12/99 ,time is now =>17:53: 01, thank you! Example 2: Display the current time in a predetermined format. # dateFri Nov 26 15:20:18 CST 1999 Example 3: Set the time to 14:36 ​​pm. # date -s 14:36:00Fri Nov 26 14:15:00 CST 1999 Example 4: The setup time is November 28, 1999. # date -s 991128Sun Nov 28 00:00:00 CST 1999 Example: Set Time Wei August 8, 2008 12:00 # date -s "2008-08-08 12:00:00" After the modification, remember Input: clock -w

Write the system time to CMOS

The above is the introduction of the change time method under linux. Friends who need it can learn from it!

Copyright © Windows knowledge All Rights Reserved