Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Red Hat Enterprise Linux 9 Essentials Book now available.

Purchase a copy of Red Hat Enterprise Linux 9 (RHEL 9) Essentials

Red Hat Enterprise Linux 9 Essentials Print and eBook (PDF) editions contain 34 chapters and 298 pages

Preview Book

13.2. Command Line Configuration

In case your system does not have the Date/Time Properties tool installed, or the X Window Server is not running, you will have to change the system date and time on the command line. Note that in order to perform actions described in this section, you have to be logged in as a superuser:
~]$ su -
Password:

13.2.1. Date and Time Setup

The date command allows the superuser to set the system date and time manually:
  1. Change the current date. Type the command in the following form at a shell prompt, replacing the YYYY with a four-digit year, MM with a two-digit month, and DD with a two-digit day of the month:
    ~]# date +%D -s YYYY-MM-DD
    
    For example, to set the date to 2 June 2010, type:
    ~]# date +%D -s 2010-06-02
    
  2. Change the current time. Use the following command, where HH stands for an hour, MM is a minute, and SS is a second, all typed in a two-digit form:
    ~]# date +%T -s HH:MM:SS
    
    If your system clock is set to use UTC (Coordinated Universal Time), add the following option:
    ~]# date +%T -s HH:MM:SS -u
    
    For instance, to set the system clock to 11:26 PM using the UTC, type:
    ~]# date +%T -s 23:26:00 -u
    
You can check your current settings by typing date without any additional argument:
Example 13.1. Displaying the current date and time
~]$ date
Wed Jun  2 11:58:48 CEST 2010


 
 
  Published under the terms of the Creative Commons License Design by Interspire