Results 1 to 12 of 12
Thread: update server time zone
-
03-07-2012, 03:07 AM #1Web Hosting Guru
- Join Date
- Aug 2007
- Posts
- 263
update server time zone
[root@server27 ~]# date
Wed Mar 7 02:17:44 EST 2012
[root@server27 ~]#
Wed Mar 7 14:17:44 MYT 2012
how to update this?
-
03-07-2012, 03:20 AM #2Temporarily Suspended
- 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"
-
03-07-2012, 04:11 AM #3Web Hosting Guru
- 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 ~]#
-
03-07-2012, 04:19 AM #4Web Hosting Master
- Join Date
- Jul 2009
- Location
- The backplane
- Posts
- 1,788
ln -sf /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime
-
03-07-2012, 05:22 AM #5Disabled
- Join Date
- Nov 2010
- Posts
- 2,564
you can use date --help for the options. regards
-
03-07-2012, 05:23 AM #6Web Hosting Guru
- Join Date
- Aug 2007
- Posts
- 263
-
03-07-2012, 06:34 AM #7WHT Addict
- Join Date
- Aug 2011
- Posts
- 134
Which distro are you using? For Ubuntu, you can try "dpkg-reconfigure tzdata"
-
03-07-2012, 06:51 AM #8Web Hosting Guru
- Join Date
- Aug 2007
- Posts
- 263
hi
i use centos
-
03-07-2012, 07:33 AM #9WHT Addict
- Join Date
- Aug 2011
- Posts
- 134
-
03-07-2012, 08:02 PM #10Web Hosting Master
- Join Date
- Jul 2009
- Location
- The backplane
- Posts
- 1,788
-
03-07-2012, 10:03 PM #11Temporarily Suspended
- 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."
-
03-08-2012, 05:43 AM #12Newbie
- Join Date
- Jan 2012
- Posts
- 19
this is my using:
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Similar Threads
-
Setting a different time zone on a server
By prashant1979 in forum Hosting Security and TechnologyReplies: 1Last Post: 10-13-2007, 12:43 PM -
How to change server Time zone ???
By mrcancel in forum Hosting Security and TechnologyReplies: 2Last Post: 04-22-2007, 04:15 AM -
How to change the server time zone
By 0218 in forum Hosting Security and TechnologyReplies: 2Last Post: 08-31-2005, 03:36 PM -
How do I change time zone at the server side ?
By nike in forum Hosting Security and TechnologyReplies: 11Last Post: 04-11-2003, 09:31 PM -
server's time zone
By Abu Mami in forum Hosting Security and TechnologyReplies: 9Last Post: 05-30-2002, 04:42 PM