How to change the system date in Linux

7 Apr, 2008  |  Posted by Danesh  |  in HowTo, Linux

A friend needed help changing the system date on his Linux box today. This is usually a simple task for Linux users but newbies tend to get confused by the "date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]” line in the man page.

To simplify, this is how you do it.

Set the current date to April 7 2008 8:42:45pm.

The easy way,

#date -s "7 April 2008 20:42:45"

The harder way,

#date 040720422008.45

The break down: MM DD hh mm YYYY ss

MM = month = 04

DD = day = 07

hh = hour = 20

mm = minute = 42

YYYY = year = 2008

ss = second = 450

sample output,

[root@klmsyslog01p ~]# date -s “7 April 2008 20:42:45″
Mon Apr 7 20:42:45 MYT 2008
[root@klmsyslog01p ~]#

[root@kmmserver01p ~]# date 040720422008.45
Mon Apr 7 20:42:45 MYT 2008
[root@kmmserver01p ~]#

  • Digg
  • del.icio.us
  • BlinkList
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Furl
  • Google
  • Live
  • Facebook
  • Pownce
  • TwitThis
  • E-mail this story to a friend!
Tags: , , , , ,

One Response so far | Have Your Say!

  1. Steven Russo  |  June 20th, 2008 at 12:28 am #

    Hi! I’m looking for both SEO and Linux admin help. If you are interested, please hit me up here! Also, if anyone knows of any open source solutions like the one located at http://www.trickylinux.com, I’d love to know about it!Thanks!Steven

    Steven Russo - Gravatar

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>