Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2007
    Posts
    263

    update server time zone

    [root@server27 ~]# date
    Wed Mar 7 02:17:44 EST 2012
    [root@server27 ~]#
    it should be as below

    Wed Mar 7 14:17:44 MYT 2012

    how to update this?

  2. #2
    Join Date
    Feb 2011
    Location
    China/HongKong
    Posts
    84
    Try syntax below, hope it works for you.

    # date -s "Wed Mar 7 14:17:44 MYT 2012"
    OR
    # date --set="Wed Mar 7 14:17:44 MYT 2012"

  3. #3
    Join Date
    Aug 2007
    Posts
    263
    [root@server27 ~]# date --set="Wed Mar 7 14:17:44 MYT 2012"
    date: invalid date `Wed Mar 7 14:17:44 MYT 2012'
    [root@server27 ~]# date
    Wed Mar 7 03:21:34 EST 2012
    [root@server27 ~]# date -s "Wed Mar 7 14:17:44 MYT 2012"
    date: invalid date `Wed Mar 7 14:17:44 MYT 2012'
    [root@server27 ~]#
    cant. it show invalid.

  4. #4
    Join Date
    Jul 2009
    Location
    The backplane
    Posts
    1,788
    ln -sf /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime

  5. #5
    you can use date --help for the options. regards

  6. #6
    Join Date
    Aug 2007
    Posts
    263
    Quote Originally Posted by [CTI] Todd View Post
    ln -sf /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime
    thanks.

    but it remain EST.

    [root@server27 ~]# ln -sf /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime
    [root@server27 ~]# date
    Wed Mar 7 04:33:38 EST 2012
    [root@server27 ~]#

  7. #7
    Which distro are you using? For Ubuntu, you can try "dpkg-reconfigure tzdata"

  8. #8
    Join Date
    Aug 2007
    Posts
    263
    hi

    i use centos

  9. #9

  10. #10
    Join Date
    Jul 2009
    Location
    The backplane
    Posts
    1,788
    Quote Originally Posted by seachen View Post
    thanks.

    but it remain EST.
    Hmmm, what is the output of ls -l /etc/localtime?

  11. #11
    Join Date
    Feb 2011
    Location
    China/HongKong
    Posts
    84
    Copy what Chris said here for your reference, hope it helps 陈.

    "How to change date/time format at CentOS

    First, make a backup of the existing localtime file. It’s always good practice to make backups of original config files.
    mv /etc/localtime /etc/localtime.bak

    Next, create the link:
    ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

    Make sure to replace “America/Chicago” with the directory (if your zone has one) and filename of the timezone you wish to use.

    Now you just need to test your change. Run “date” from the command line, and ensure that the appropriate time, date, and timezone are reported."

  12. #12
    this is my using:

    rm -rf /etc/localtime
    ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Similar Threads

  1. Setting a different time zone on a server
    By prashant1979 in forum Hosting Security and Technology
    Replies: 1
    Last Post: 10-13-2007, 12:43 PM
  2. How to change server Time zone ???
    By mrcancel in forum Hosting Security and Technology
    Replies: 2
    Last Post: 04-22-2007, 04:15 AM
  3. How to change the server time zone
    By 0218 in forum Hosting Security and Technology
    Replies: 2
    Last Post: 08-31-2005, 03:36 PM
  4. How do I change time zone at the server side ?
    By nike in forum Hosting Security and Technology
    Replies: 11
    Last Post: 04-11-2003, 09:31 PM
  5. server's time zone
    By Abu Mami in forum Hosting Security and Technology
    Replies: 9
    Last Post: 05-30-2002, 04:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •