LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Date/Time in Slackware 12.0 (http://www.linuxquestions.org/questions/slackware-14/date-time-in-slackware-12-0-a-642656/)

JMJ_coder 05-16-2008 09:17 AM

Date/Time in Slackware 12.0
 
Hello,

Still running 12.0 and I have a question on the date/time function. I also use NetBSD and I noticed that the time was three hours behind (i.e., shows 8:00a, but really 11:00a). So I used the date string command to reset the clock to the correct time. Now, the time in Slackware is three hours ahead (i.e., shows 11:00a, but really 8:00a). As far as I know, both are set to the same timezone (Eastern Time - America/New_York).

Does anyone know how to resolve this difference?

dracolich 05-16-2008 09:23 AM

I solved a similar issue earlier this year by using the --localtime parameter with the date command. Something like this:

Code:

date --localtime --set 08:00
I always follow a date command with hwclock --systohc

I'm writing this from memory so my syntax may be slightly incorrect

T3slider 05-16-2008 01:46 PM

You should make sure the permissions are correct on /etc/localtime (readable by others). Also, when setting the date/time you can either store the local time in the hardware clock or you can store it in UTC. Be sure to run `hwclock --systohc` as dracolich said above to sync the software time with the hardware clock.

JMJ_coder 05-17-2008 06:10 PM

Hello,

I was able to resolve this by adding rtclocaltime=YES to the /etc/rc.conf file on NetBSD. Now both systems are set to the same correct time.


Thanks for the suggestions.


All times are GMT -5. The time now is 04:55 AM.