How to modify the system time in Linux
Hi all,
I am using Linux command based operating system. I ma very new in this OS. It is very secure operating system and i like it. But i find one issue in this, that i am not able to modify the system date and time in this system . Please help. Thanks in advance.
How to modify the system time in Linux
If you want to modify Linux system date, you can use the date command time
Time is set to May 10, 2009 order is as follows:
Code:
# date-s 05/10/2009
The system time set to 10:18:00 the command is as follows.
Please reply if you found any issue.
How to modify the system time in Linux
You can also modify the time zone by below commad: Locate the appropriate time zone file / usr / share / zoneinfo / Asia / Shanghai to replace the current / etc / localtime.
Code:
Modify / etc / sysconfig / clock file says:
ZONE = "Asia / Shanghai"
UTC = false
ARC = false
Check and reply.
How to modify the system time in Linux
Date command function is to display and set the system date and time. Enter date see the current system time. Modified need to date - features character modifications. Command meaning of each option are as follows:
-d datestr, - date datestr show the date described by the datestr -sdatestr, - set datestr to set the date datestr Description-u, - universal display or set the Universal Time temporal
Code:
% H hour (00 .. 23)
% I hour (01 .. 12)
% k hour (0 .. 23)
% l hour (1 .. 12)
% M minutes (00 .. 59)
% p shows AM or PM
% r Time (hh: mm: ss AM or PM), 12 Xiao Shi
% s from January 1, 1970 00:00:00 to the current experience of the number of seconds
% S seconds (00 .. 59)
% T time (24 hour clock) (hh: mm: ss)
% X shows the time format (% H:% M:% S)
% Z time zone date of the domain
% a few weeks short (Sun.. Sat)
% A full name of the week (Sunday.. Saturday)
% b abbreviated month (Jan.. Dec)
% B full name of the month (January.. December)
% c Date and time (Mon Nov 8 14:12:46 CST 1999)
% d month of the first few days (01 .. 31)
% D date (mm / dd / yy)
% h and% b option is the same as
% j the first days of the year (001 .. 366)
% m month (01 .. 12)
% w the first few days a week (0 for Sunday)
% W the first few weeks of the year (00 .. 53, on Monday for the first day)
% x shows the date format (mm / dd / yy)
% y last two digits of year (1999 99)
% Y year (example: 1970,1996, etc.)
Check and reply.
How to modify the system time in Linux
The format of the specified display time is like:.
Code:
$ Date '+ This date now is =>% x, time is now =>% X, thank you!'
This date now is => 11/12/09, time is now => 17:53:01, thank you!
Example 2: Using a predefined format and displays the current time.
# Date
Fri Nov 26 15:20:18 CST 2009
Code:
Set time to 14:36 pm.
# Date-s 14:36:00
Fri Nov 26 14:15:00 CST 2009
Example 4: Set the time to November 28, 2009
# Date-s 991128
Sun Nov 28 00:00:00 CST 2009
All the best.
How to modify the system time in Linux
You can also synchronization bios time. BIOS clock synchronization to force the system time to write CMOS, the command is as follows:
Example:
Code:
Set the time-ind at 12:00 on August 8, 2008
# Date-s "2008-08-08 12:00:00"
Modify finished, remember the type: clock-w. Time to write the system CMOS