unix

How do I set the date and time on a Linux server?

To set the date following syntax to set new data and time:

date –set=”STRING”

For example, to set the new date to 23 July 2010 06:00:00, type the following command as root user:

date -s “23 JUL 2010 06:00:00”

Or

date –set=”23 JUL 2010 06:00:00″

You can also simplify the format using following syntax:

date +%Y%m%d -s “20100723”

To set the time

To set time you can use the command below.

date +%T -s “06:25:13”

4 Comments

4 Comments

  1. Matthew Herzog

    August 4, 2010 at 12:45 pm

    You may want to run the ntp client to keep your server in sync. Having at least one ntpd server on your LAN is also a good idea. That way all the servers on your network will be synchronized to the same time.

  2. Backlinks

    August 30, 2010 at 11:40 pm

    This is a good blog. Keep up all the work. I too love blogging and expressing my opinions. Thanks 🙂

  3. Bianca Kroenke

    August 31, 2010 at 2:36 am

    Hello can I quote some of the content here in this blog if I provide a link back to your site?

    • admin

      August 31, 2010 at 9:27 am

      Bianca,

      Sure, that’s fine.

      The MyTechForum.com Team

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top