Linux Set Date and Time From a Command Prompt

How can I set the system date and time from the command prompt (bash shell)? I don’t have GUI installed and I am login over ssh session. How can I set date under Linux operating systems?

Use the date command to display the current date and time or set the system date / time over ssh session. You can also run the date command from X terminal as root user.

ADVERTISEMENTS

[donotprint]
Tutorial details
DifficultyEasy (rss)
Root privilegesYes
RequirementsNone
Time2m
[/donotprint]This is useful if the Linux server time and/or date is wrong, and you need to set it to new values from the shell prompt.

You must login as root user to use date command.

Linux Display Current Date and Time

Just type the date command:
$ date
Sample outputs:

Mon Jan 21 01:31:40 IST 2019

Linux Display The Hardware Clock (RTC)

Type the following hwclock command to read the Hardware Clock and display the time on screen:
# hwclock -r
OR
# hwclock --show
$ sudo hwclock --show --verbose

Linux get hardware date and time command
OR show it in Coordinated Universal time (UTC):
# hwclock --show --utc
Sample outputs:

2019-01-21 01:30:50.608410+05:30

Linux Set Date Command Example

Use the following syntax to set new data and time:
date --set="STRING"
For example, set new data to 2 Oct 2006 18:00:00, type the following command as root user:
# date -s "2 OCT 2006 18:00:00"
OR
# date --set="2 OCT 2006 18:00:00"
You can also simplify format using following syntax:
# date +%Y%m%d -s "20081128"

Linux Set Time Examples

To set time use the following syntax:
# date +%T -s "10:13:13"
Where,

  • 10: Hour (hh)
  • 13: Minute (mm)
  • 13: Second (ss)

Use %p locale’s equivalent of either AM or PM, enter:
# date +%T%p -s "6:10:30AM"
# date +%T%p -s "12:10:30PM"

How do I set the Hardware Clock to the current System Time?

Use the following syntax:
# hwclock --systohc
OR
# hwclock -w

A note about systemd based Linux system

With systemd based system you need to use the timedatectl command to set or view the current date and time. Most modern distro such as RHEL/CentOS v.7.x+, Fedora Linux, Debian, Ubuntu, Arch Linux and other systemd based system need to the timedatectl utility. Please note that the above command should work on modern system too.

timedatectl: Display the current date and time

Type the following command:
$ timedatectl

Fig.01: Systemd Linux timedatecetl command to display the current date and time

Fig.01: Systemd Linux timedatecetl command to display the current date and time

How do I change the current date using the timedatectl command?

To change the current date, type the following command as root user:
# timedatectl set-time YYYY-MM-DD
OR
$ sudo timedatectl set-time YYYY-MM-DD
For example set the current date to 2015-12-01 (1st, Dec, 2015):
# timedatectl set-time '2015-12-01'
# timedatectl

Sample outputs:

      Local time: Tue 2015-12-01 00:00:03 EST
  Universal time: Tue 2015-12-01 05:00:03 UTC
        RTC time: Tue 2015-12-01 05:00:03
       Time zone: America/New_York (EST, -0500)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2015-11-01 01:59:59 EDT
                  Sun 2015-11-01 01:00:00 EST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2016-03-13 01:59:59 EST
                  Sun 2016-03-13 03:00:00 EDT

To change both the date and time, use the following syntax:
# timedatectl set-time YYYY-MM-DD HH:MM:SS
Where,

  1. HH : An hour.
  2. MM : A minute.
  3. SS : A second, all typed in two-digit form.
  4. YYYY: A four-digit year.
  5. MM : A two-digit month.
  6. DD: A two-digit day of the month.

For example, set the date ’23rd Nov 2015′ and time to ‘8:10:40 am’, enter:
# timedatectl set-time '2015-11-23 08:10:40'
# date

How do I set the current time only?

The syntax is:
# timedatectl set-time HH:MM:SS
# timedatectl set-time '10:42:43'
# date

Sample outputs:

Mon Nov 23 08:10:41 EST 2015

How do I set the time zone using timedatectl command?

To see list all available time zones, enter:
$ timedatectl list-timezones
$ timedatectl list-timezones | more
$ timedatectl list-timezones | grep -i asia
$ timedatectl list-timezones | grep America/New

To set the time zone to ‘Asia/Kolkata’, enter:
# timedatectl set-timezone 'Asia/Kolkata'
Verify it:
# timedatectl

      Local time: Mon 2015-11-23 08:17:04 IST
  Universal time: Mon 2015-11-23 02:47:04 UTC
        RTC time: Mon 2015-11-23 13:16:09
       Time zone: Asia/Kolkata (IST, +0530)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

How do I synchronizing the system clock with a remote server using NTP?

Simply type the following command:
# timedatectl set-ntp yes
Verify it:
$ timedatectl
Sample outputs:

      Local time: Mon 2015-11-23 08:18:49 IST
  Universal time: Mon 2015-11-23 02:48:49 UTC
        RTC time: Mon 2015-11-23 02:48:50
       Time zone: Asia/Kolkata (IST, +0530)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a
Conclusion

Linux users can use date command to print or set the system date and time. Systemd based Linux users can use timedatectl to control the system time and date.

  • You can also set new timzone using this mini-howto.
  • Man pages – timedatectl(8)
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
145 comments… add one
  • Johan Dalevi Apr 8, 2007 @ 20:51

    Found out i had to set the date like this:
    # date -s 2007.04.08-22:46+0000

    • PRADEEP Dec 20, 2010 @ 3:19

      date -s “2 OCT 2006 18:00:00”

    • Edward biney Aug 2, 2014 @ 15:55

      I want to set the date and time on my phone

  • mani Dec 12, 2007 @ 6:57

    How can I set the proxy setting from the command prompt (bash shell)?

    • Mike Jul 20, 2017 @ 18:53

      Any of the following should work:
      export http_proxy=http://server.address:port
      export https_proxy=https://server.address:port
      export ftp_proxy=ftp://server.address:port

  • raju Jan 10, 2008 @ 7:25

    Just This code is ultimate.It is simple and worth full.Thank you very much providing help to people.

    • carls junior Apr 18, 2016 @ 22:14

      Of course

  • kiran Mar 8, 2008 @ 4:26

    It Work’s Thanks a Lot,

    Kiran.

  • djeikyb May 21, 2008 @ 0:18

    mani– run:
    export http_proxy=’http://10.10.1.2:3128′

  • R.K.Majhi Jun 24, 2008 @ 13:29

    It helped me to change the server timings without any difficulty. I tried to get help from the command prompt but it didn’t render anything. Thanks for the solution.

  • Mohit Guleria Jun 27, 2008 @ 17:08

    Do check and sync hardware clock with:
    # hwclock –show
    # hwclock –systohc

    • Maurice Mar 6, 2013 @ 6:38

      This is actually an important one!! Many thanks!

    • bryan Apr 23, 2014 @ 14:05

      Thanks a ton Mohit, this is what i was looking for.

  • Paolo Jul 24, 2008 @ 12:16

    This configuration string is exactly what i’m searching for. thanks.

  • job wakhungu Jul 30, 2008 @ 16:49

    i had to set the date by using {date -s “wed jul 30 19:41:00 BST 2008”} while at the root.

  • gujubhai Aug 13, 2008 @ 9:43

    hey thanks a million,
    this worked right the first time…

    was wondering how to do it untill i found ur site…

    keep up the good work…very neat for freshers to *nix

    cheers

  • rostiarso Aug 21, 2008 @ 3:41

    You could also simplify the format of input date as example below
    date +%Y%m%d -s "20080817" (set new date to August 17, 2008) without typing full date format

  • Abdussami Oct 26, 2008 @ 11:35

    Just amazing command… & help.. gr88 work.. keep it up.

    May allah bless you…

  • marius Oct 27, 2008 @ 19:07

    thank you!!!!

    i have fedora 9 i can not change the time using his time control application. he ask for my root password, and then he says that it is not correct…. crazy program :)

    the man page of date did not showed me any example, i what i tried was not accepted.

    thank you.

  • D Nov 2, 2008 @ 10:09

    Thanks

  • pramod Nov 7, 2008 @ 4:11

    this is gr8
    I synced HW clk with sysstem clock also.
    But after reboot the time is again changed

  • Frank Haynes Nov 27, 2008 @ 18:35

    The man page for the ‘date’ command is WORTHLESS.

    Now that I read here how to format the input string in order to set the clock my life is good. THANK YOU!

  • saiph savage Nov 28, 2008 @ 15:22

    thanks !
    very nice article, super easy :)

  • Venu Reddy Dec 18, 2008 @ 6:35

    Thanks brother,
    It has worked. Great work…!

  • Neelesh Dec 22, 2008 @ 14:04

    date set=”2 OCT 2006 18:00:00″

    it is doesn’t work.
    I have to change my linux system time./ Right now it is shows correct time on my machine but when i open my gmail account it’s shows wrong time of my emails.Due to it’s system time.

    Any idea?

  • Dennis Quek Jan 21, 2009 @ 5:10

    Anyone has ideas how to set Dates 1 day or 2 dates ago. What about setting it +2 hours in advance etc ?

  • Nickalf Feb 11, 2009 @ 19:49

    Hi All,

    The problem I’m having is, the time/date changes at the time I do it, but doesn’t hold after a reboot – how can i lock it into the Server’s clock..

    Neelesh – Try date -s “2 OCT 2006 18:00:00” instead

    Nickalf. . .

    • Aman Sep 2, 2011 @ 5:58

      date –set=”2 sep 2011 11:27:20″

    • zia Mar 6, 2012 @ 3:02

      date -s “2 OCT 2006 18:00:00” Thanks it worked nicely oh! thanks

  • Adnan Feb 17, 2009 @ 9:01

    Thanx alot.. working properly

  • Bimlesh sharma Feb 24, 2009 @ 11:28

    date -s ”2 OCT 2006 18:00:00″ is set for the time being. Need o set CMOS clock using “hwclock” command. That will be right solution.

  • C Chavez Mar 3, 2009 @ 21:41

    SIDE NOTE RE: SETTING HWCLOCK

    format should be:

    # hwclock –systohc

    (note double -)

    CHeers!

  • George Mar 18, 2009 @ 5:57

    Thanks alot

    THis has worked like yesterday

    Keep up the good work.

    Regards,

    George Ndung’u
    IT & Logistics Manager
    LSHS

  • Ajay Shaldiwal Mar 20, 2009 @ 6:30

    Dear Sir,

    Thanks a Lot.

    Ajay

  • Mister D May 5, 2009 @ 9:17

    Thanks!!!

  • Gopal May 5, 2009 @ 17:59

    One more thank you for your simple explanation and great example. I couldn’t figure out the format from reading the date man page.

  • Zahid May 14, 2009 @ 12:26

    Nice

  • cat Jun 1, 2009 @ 12:12

    Thank you so much, it works.

  • en Jun 13, 2009 @ 9:14

    Thank you! This information was very helpful.

    Some of the examples you have presented here would be hard to derive from the date man page.

  • Alan Jul 25, 2009 @ 21:20

    I’ve just got a Datawind Ubisurfer and to set the date/time I had to type:
    # date 07252208002009
    25 July 2009 time 20:08

    decodes as # date MMDDhhmmssYYYY

    month day hour minutes seconds year
    Thanks for other scripts they sent me in the right direction.
    (This does come up as UTC whatever that is!)

  • herMz Aug 10, 2009 @ 9:33

    this is awesome.. thnks a lot..

  • Srini Aug 18, 2009 @ 14:01

    Thanks…:)

  • FAHIM Aug 28, 2009 @ 15:48

    Thanks its works….!!!

  • Dattatray Naik Sep 5, 2009 @ 7:42

    Thanks It Works.

  • vignesh Sep 6, 2009 @ 7:03

    Thanks for giving the command.. It’s very helpful for me.

  • Murugesh Sep 8, 2009 @ 17:33

    info date Examples

  • thomas Sep 16, 2009 @ 11:12

    I am a layman in linux, but this sure helped me change my server time remotely.thankyou.

  • Kent Sep 25, 2009 @ 9:03

    Thanks C Chavez. I had a real time trying to get the hwclock to stop resetting. One line and BAM! Thanks again!

  • seth Oct 1, 2009 @ 14:18

    THIS COMMAND DOESN’T WORK FOR OPEN BSD TO CHANGE THE DATE AND TIME

  • bharanitharan Oct 5, 2009 @ 23:16

    Thanks Man :) it have worked for me ;-)

  • vinodanctk@gmail.com Oct 29, 2009 @ 8:23

    Dear sir,
    Many Thanks for the help
    Thanks

  • Mario Chamorro Nov 4, 2009 @ 20:43

    Thank you , Murugesh . This is the first time I have ever found those ‘Info’ pages useful . I need this for a SQL script at work that needs to fetch data from 7 days ago . Murugesh to the rescue!

    [ ~ ] date –date=’7 days ago’
    Wed Oct 28 20:39:35 GMT 2009
    [ ~ ]

    — Mario

    • LINUXKIDA Jan 9, 2015 @ 13:47

      is there any command to find date after x days in future

  • Jaxon Nov 9, 2009 @ 8:35

    It works, I have to check any time changing after restart the PC

  • sin Dec 9, 2009 @ 18:31

    thanks it worked in first time… Really Thanks

  • Sana Dec 22, 2009 @ 4:43

    Thanks a lot for your help

  • nenopera Jan 18, 2010 @ 9:11

    $ sudo date +%Y%m%d%T -s “20081225 10:05:00”

    [sudo] password for nenopera:
    2008122510:05:00

    $ date

    Thu Dec 25 10:05:02 EST 2008

  • sumer Feb 8, 2010 @ 7:19

    `date +%G%m%d`-acb.txt
    this is my current date format. I wants to set last day’s date instead of current. I try this from last week . Plz help me…………

  • shabbirali Mar 3, 2010 @ 8:07

    Date command is sweet and simple… :)
    Man page is man!!!

  • sumer Mar 3, 2010 @ 10:21

    thanks guys….lov u ……..

  • ratish singh Mar 15, 2010 @ 13:41

    How can i change my system date format on linux os?

  • vishal Apr 9, 2010 @ 8:28

    satish,

    follow the steps
    1.check date with date command
    2.set date with date -s command
    3.hwclock –systohc
    4.hwclock –show

    Vishal

    • sunraj Jun 9, 2010 @ 13:28

      i like your commands. i am realy very impress

  • Indika Apr 23, 2010 @ 17:09

    Hi this is really helpful guys….. thanks alot.

  • the birdie Apr 29, 2010 @ 11:20

    Thanks for passing on your knowledge.

  • luciano May 13, 2010 @ 15:22

    # date set=”2 OCT 2006 18:00:00″ wrong!!!!
    # date –set=”2 OCT 2006 18:00:00″

  • gayan Jun 11, 2010 @ 3:45

    thinks bro,

  • Vikas YAdav Jun 26, 2010 @ 8:36

    It was amazing……!!!!!!!!!

  • praV Jul 9, 2010 @ 16:47

    THANKS

  • P.K.Ghosh Jul 29, 2010 @ 6:57

    Thank yo very much for sharing your knowledge
    It’ really works fine
    So… bye

  • kiran Oct 25, 2010 @ 9:19

    Thank you very much for giving me suggestion it is very usefull for me.

    regards,
    kiran ugale.

  • vijay Nov 9, 2010 @ 4:28

    Thanks a lot guys.. Everything worked.

  • William Simbota Nov 11, 2010 @ 12:46

    I really appreciate. I think I will learn Linux at a fast pace with your assistance.

  • Naresh Babu Dec 21, 2010 @ 12:26

    Information about date was very much helped me
    Thanks

  • seachen Jan 13, 2011 @ 17:36

    my vps time currently is as below:

    [root@server25 ~]# date
    Thu Jan 13 17:22:54 UTC 2011

    how to change it to Thu Jan 14 01:25:54 MYT 2011

  • iskandar Jan 27, 2011 @ 6:45

    hai…
    im have a problem about time on fedora
    im use tht comman date, its change but if i restart my fedora is time will change
    and wrong time after restart the komputer..
    can help me?

  • iskandar Jan 27, 2011 @ 7:40

    now i understand how tht comman
    tq friend..
    now my fedora time is ok
    the time is ok not change anymore..
    Tq

  • micxz Mar 18, 2011 @ 15:34

    not a big deal but small typo:
    # 30: Second (ss)
    should read 13 or in the example it should be :30

  • ankit maini Mar 22, 2011 @ 13:13

    thanx :)

  • dani Mar 25, 2011 @ 6:37

    hello i want to change date separator… from / to .(dot) can u help me?
    for example 23/03/2011 to 23.03.2011

  • Mohit G Apr 11, 2011 @ 13:38

    View:
    hwclock –show
    date
    ls -l /etc/localtime

    Change:
    To change the time use date followed by the month, day, hour, minute, and year all numeric and no spaces.
    date 041106232011
    hwclock –systohc
    ln -sf /usr/share/zoneinfo/ /etc/localtime
    vi /etc/sysconfig/clock (update timezone if redhat)
    service ntpd restart

    Check:
    hwclock –show
    date
    ls -l /etc/localtime

  • mz May 24, 2011 @ 9:41

    it worked fine.
    MZ

  • Jaat Jun 25, 2011 @ 11:07

    How to change duplex setting of lan card in Rhel5

    • Brent Nov 30, 2012 @ 22:54

      On the same subject, how do I make non-dairy chocolate chip cookies?

  • sasi Jul 30, 2011 @ 11:27

    thankz

  • Erik Martis Aug 16, 2011 @ 18:27

    Hi there,

    thank you very much for the info …. works like a charm !!!
    btw, once I set my system date and time correctly the use of the
    “#hwclock –systohc” command rules ´em all too !!!

    saludos!
    eriku

  • prince f Nov 14, 2011 @ 18:37

    thank you!

  • Soni Peterson Dec 23, 2011 @ 3:49

    To me, setting date and time in linux was really difficult and I was searching many documents / websites for this, and thank you very much for such comprehensive information for setting date and time. It helps me a lot.

  • surendra Feb 6, 2012 @ 11:00

    Thanks

  • sam Mar 6, 2012 @ 10:32

    not a big deal , just type :

    #date 030613252012
    03=March
    06=Day
    13=Hour
    25=Min
    2012=Year

    That’s IT :)

  • prabhat Mar 27, 2012 @ 16:01

    Hey guys i have tried each and every command to change my linux server time but after i try every command new time is displayed.But when i try to verify it by running date command it shows old time again.Plssss help me……..

    • sam Mar 28, 2012 @ 9:30

      my friend this one is working fine nor more no less :

      [server#] date 030613252012

      it means :
      03=March
      06=Day
      13=Hour
      25=Min
      2012=Year

      That’s IT :)

      • prabhat singh Mar 30, 2012 @ 14:06

        after running this command , do i have to run any other command also?

        • sam Apr 3, 2012 @ 9:28

          nothing ;

          just to make sure run :
          #date

          and see the date ;

  • sunay Sep 12, 2012 @ 8:21

    its easy to change date or time

  • Rao Sep 14, 2012 @ 14:22

    Helped a lot…Thanks…

  • Ahamed Bauani Oct 11, 2012 @ 20:28

    Thanks a lot for your help. But problem is there is no way to change the date if it is a VPS server :(

  • Sam Oct 12, 2012 @ 17:31

    There is no different between actual server and virtual server ; you can use same command to change the date :

    [VPS-server]# date 030613252012

    it means :
    03=March
    06=Day
    13=Hour
    25=Min
    2012=Year

  • Sam Oct 17, 2012 @ 20:01

    Could you please tel me what distribution of linux that you are using ?

  • hapoint from bpoint Oct 31, 2012 @ 12:58

    Thanks :)

  • dipesh Mar 15, 2013 @ 15:47

    This is all awesome guys… many thanks

  • Ricky1990 Apr 8, 2013 @ 14:11

    I really thank you so much because of my wordpress site display wrong date. After read this post, i’ve just changed it. Thanks so much again !

  • Milton May 11, 2013 @ 7:33

    Very helpful article.

  • yusuf Oct 19, 2013 @ 11:48

    HI,

    how do i update time one linux machine to another machine via command ?

  • PRAVEEN Nov 19, 2013 @ 2:10

    I am getting below error while changing the time. can any one tell me how to resove it.
    [cnems@SVT-CSM-01-M:/etc] date 1026140013
    date: cannot set date: Operation not permitted
    Sat Oct 26 14:00:00 BST 2013
    [cnems@SVT-CSM-01-M:/etc]

  • Sam Nov 19, 2013 @ 6:00

    Please see the below sample :
    [Server#] date 030613252012

    it means :
    03=March
    06=Day
    13=Hour
    25=Min
    2012=Year

  • sal Nov 22, 2013 @ 19:19

    I have a VCX Connect box, a V7005, that accepts some of the commands on this page to change the date however the date is not actually changed. I’ve ran the following to no avail:

    # DATE -S “22 NOV 2013 10:00:00”

    This in different variations.

    Might anyone know if there is another syntax associated with a 3com VCX box?

  • Sam Nov 24, 2013 @ 5:56

    have you tried the command that I have shared with you , and what was the output ?

    Please see the below sample :
    [Server#] date 030613252012

    it means :
    03=March
    06=Day
    13=Hour
    25=Min
    2012=Year

  • sal Nov 25, 2013 @ 16:35

    Hi Sam

    I managed to change the time on our VCX Linux box by entering one different variations of the command below. Not sure of the exact syntax but it goes something like this:

    # DATE -SET “22 NOV 2013 10:00:00 PST″

    It took a short while for the change to reflect on the box and all phones. Short while meaning a few hours.

  • Sam Nov 26, 2013 @ 8:46

    Dear ,

    Could you please share with me the output of below command ?

    # uname -a

    Thanks

  • taufeeq Jan 12, 2014 @ 6:04

    not working says cannot set date:operation not permitted
    what i can do?

    • Jose A. Morales Jul 6, 2015 @ 14:19

      Are you doing it under root? su first?

  • Sam Jan 13, 2014 @ 13:51

    Check , weather you are root user , or not .
    normal user , cant change date .

    date -s “YYYY-MM-DD HH:MM:SS”

    • taufeeq Jan 18, 2014 @ 5:36

      any trick to change?

  • sam Jan 18, 2014 @ 19:43

    please send me the output of the below command :

    # uname -a

  • taufeeq Jan 19, 2014 @ 7:57

    [mphs@mphs ~]$ date –set”4 JAN 2014 1:25:00″
    date: unrecognized option ‘–set4 JAN 2014 1:25:00′
    Try `date –help’ for more information.
    [mphs@mphs ~]$ ^C
    [mphs@mphs ~]$

    • 🐧 Nix Craft Jan 19, 2014 @ 10:57

      You need to run date as root user:

      sudo date --set="4 JAN 2014 13:25:00"
      • taufeeq Jan 19, 2014 @ 16:08

        @Nix craft, its asking password but i don’t know the password and its impossible to know the password bcoz our system admin set its secretly

        [mphs@mphs ~]$ sudo date –set=”4 JAN 2014 9:35:00″
        [sudo] password for mphs:

        • 🐧 Nix Craft Jan 19, 2014 @ 16:55

          Try your own password. Also, you need to be root (sysadmin) or part of sysadmin group in /etc/sudoers to change system date. A normal user can not change system date or time due to security reasons.

          • taufeeq Jan 20, 2014 @ 13:28

            ok got it thx for help

  • sam Jan 19, 2014 @ 9:43

    Mr. Taufeeq

    here is my Skype ID :

    mos3535

    regards
    mosleh

  • taufeeq Jan 19, 2014 @ 16:04

    here is out for # uname -a

    [mphs@mphs ~]$ uname -a
    Linux mphs 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 i686 i386 GNU/Linux
    [mphs@mphs ~]$

  • sam Jan 19, 2014 @ 20:37

    can also please run the below command :

    # python -c ‘import platform ; print platform.dist()[0]’

    and send the output here .

    Skype : mos3535

    • taufeeq Jan 20, 2014 @ 4:09

      [mphs@mphs ~]$ python -c ‘import platform ; print platform.dist[0]’
      Traceback (most recent call last):
      File “”, line 1, in
      TypeError: ‘function’ object is unsubscriptable
      [mphs@mphs ~]$

      sorry bro m not on skype

  • sam Jan 20, 2014 @ 10:47

    please as I told you , try to change date by supper user like root user:

    # su –

    if it ask you for password , you should know root password
    if not , please create password for root like this :

    # passwd root

  • Maurice Mar 6, 2014 @ 21:17

    It even worked on the OLPC XO1

  • evhol Jun 3, 2014 @ 6:41

    thanks

  • Ajit Jun 6, 2014 @ 17:47

    Thanks a lot.

  • kishan Jun 17, 2014 @ 5:39

    hello guys ..how to install VLC player in fedora 14 64bit

  • Matt Jul 1, 2014 @ 15:49

    when I use:

    date +%T -s “10:13:13″

    or

    date –set=”10:13:13” the time is reset to 00:00:00.

    Is there a solution to this?

  • sam Jul 2, 2014 @ 7:02

    To do what ?
    use the command below to change back the date and time :

    # date -s “YYYY-MM-DD HH:MM:SS”

  • Fela Aug 12, 2014 @ 13:09

    thanks for sharing

  • Imad Sep 6, 2014 @ 9:48

    Really helped me.
    thanks for sharing..

  • Narayana Reddy Sep 19, 2014 @ 11:37

    Even though if i set the system time using the command “date -s ” ” when i restart it again showing the old time y? is it the problem of c-mos battery or is there any other command to set time .

    • Fela Oct 9, 2014 @ 12:17

      Hi Naraya,
      I would advice you to check the cmos, that is most likely the biggest problem.
      Before you sort that out; after setting the date using the command #date –set = “STRING”, remember to follow with the use of command # hwclock –systohc

  • vsj Oct 8, 2014 @ 2:01

    it works thanks

  • Gunasekar Oct 29, 2014 @ 13:21

    I am trying to change the time from EDT to PDT
    I have tried preety much everything still doent work.

    i have changed
    :[/etc/sysconfig]# ls -l /etc/localtime
    lrwxrwxrwx 1 root root 37 Oct 28 15:48 /etc/localtime -> /usr/share/zoneinfo/America/Vancouver
    i have updated /etc/sysconfig/clock with Vancouver
    but when i run service ntpd restart , i get
    Shutting down ntpd: [FAILED]
    Starting ntpd: [ OK ]

    —————————————————————
    still shows the Eastern time.. :(
    [/etc/sysconfig]# date
    Wed Oct 29 09:20:40 EDT 2014

    • boss Jul 13, 2015 @ 23:12

      Hey you should try:

      1. cd /usr/share/zoneinfo
      2. tzselect
      3. follow the prompts.

  • tewst Nov 24, 2014 @ 9:04

    what about service ntpd? need to stop before time change?

  • IT_Arafat (Viettel_TZ) Jul 12, 2015 @ 17:10

    Good n thanks much.Real work as intended

  • Ranjith Jan 11, 2016 @ 7:01

    I was trying the same thing but then when you reboot the device /system the date will come back to previous state . So this is what u can try
    vi /etc /timezone
    and change the setting over there to IST+530 or just make it IST if the time is shown as + or – the current time

    Regards,
    R&R

  • The Dude Apr 15, 2016 @ 3:51

    Every time I google this, I’m looking for this:

    ntpdate ntp.ubuntu.com

    Hello, future me.

  • Wellington Torrejais da Silva Sep 23, 2016 @ 18:45

    Thanks!

  • Jonnyw2k Oct 2, 2016 @ 18:11

    Cheers, just did this on the 2nd October, spooky

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.