Personal tools
You are here: Home Les outils logiciels Unix Unix - Commandes - date
Navigation
Log in


Forgot your password?
 

Unix - Commandes - date

3.2.2. Changing the Current Time

To change the current time, run the date command with the --set or -s option as root:
date --set HH:MM:SS
Replace HH with an hour, MM with a minute, and SS with a second, all typed in two-digit form.
 
 
To change the current time to 11:26 p.m., run the following command as root:
~]# date --set 23:26:00
 

3.2.3. Changing the Current Date

To change the current date, run the date command with the --set or -s option as root:
date --set YYYY-MM-DD
Replace YYYY with a four-digit year, MM with a two-digit month, and DD with a two-digit day of the month.
Note that changing the date without specifying the current time results in setting the time to 00:00:00.

Example 3.8. Changing the Current Date

To change the current date to 2 June 2017 and keep the current time (11:26 p.m.), run the following command as root:
~]# date --set "2017-06-02 23:26:00"
 
 
 
 
Source :
 
Document Actions
« April 2024 »
April
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930