I have installed CentOS on a VM by checking 'System Clock uses UTC' option. Later I selected CST time zone. Now the date command shows UTC time with CST timezone: "Thu Dec 1 04:14:39 CST 2011". How do I change system clock to show CST local time? Also, more likely a dumb question but why isn't date command showing UTC here instead of CST?
jM
On Thu, Dec 1, 2011 at 9:47 PM, Johan Martinez jmartiee@gmail.com wrote:
I have installed CentOS on a VM by checking 'System Clock uses UTC' option. Later I selected CST time zone. Now the date command shows UTC time with CST timezone: "Thu Dec 1 04:14:39 CST 2011". How do I change system clock to show CST local time? Also, more likely a dumb question but why isn't date command showing UTC here instead of CST?
jM _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
This will be useful to you.
http://www.linuxsa.org.au/tips/time.html
With regards,
On Thu, Dec 1, 2011 at 10:30 AM, Digvijay Patankar dbpatankar@gmail.comwrote:
On Thu, Dec 1, 2011 at 9:47 PM, Johan Martinez jmartiee@gmail.com wrote:
I have installed CentOS on a VM by checking 'System Clock uses UTC'
option.
Later I selected CST time zone. Now the date command shows UTC time with CST timezone: "Thu Dec 1 04:14:39 CST 2011". How do I change system clock to show CST local time? Also, more likely a dumb question but why isn't date command showing UTC here instead of CST?
jM _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
This will be useful to you.
http://www.linuxsa.org.au/tips/time.html
With regards,
Thanks for the useful link. It was really helpful.
jM.
On 12/01/2011 10:17 AM, Johan Martinez wrote:
I have installed CentOS on a VM by checking 'System Clock uses UTC' option. Later I selected CST time zone. Now the date command shows UTC time with CST timezone: "Thu Dec 1 04:14:39 CST 2011". How do I change system clock to show CST local time? Also, more likely a dumb question but why isn't date command showing UTC here instead of CST?
you told it that the system clock is set to UTC ... it sets the time based on that when it boots up.
But, your system clock is NOT really set to UTC, it is set to CST. So you lied :D
That means it is going to shift your CST value by the amount of hours you are away from CST as a correction, since you told it that the hardware clock is set to UTC.
What you need to do to fix it is edit "/etc/sysconfig/clock" and if there is a UTC=true, change it to UTC=false.
Thanks for the explanation Johnny. I checked on 'System Clock uses UTC' option and on the next screen I set timezone to CST. I don't remember what exactly I did there.
I changed /etc/sysconfig/clock as you mentioned and then also changed the currently set datetime using date command. Then I installed ntp to manage system time. And it's working as fine now.
jM
On Thu, Dec 1, 2011 at 10:39 AM, Johnny Hughes johnny@centos.org wrote:
On 12/01/2011 10:17 AM, Johan Martinez wrote:
I have installed CentOS on a VM by checking 'System Clock uses UTC'
option.
Later I selected CST time zone. Now the date command shows UTC time with CST timezone: "Thu Dec 1 04:14:39 CST 2011". How do I change system clock to show CST local time? Also, more likely a dumb question but why isn't date command showing UTC here instead of CST?
you told it that the system clock is set to UTC ... it sets the time based on that when it boots up.
But, your system clock is NOT really set to UTC, it is set to CST. So you lied :D
That means it is going to shift your CST value by the amount of hours you are away from CST as a correction, since you told it that the hardware clock is set to UTC.
What you need to do to fix it is edit "/etc/sysconfig/clock" and if there is a UTC=true, change it to UTC=false.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos