LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to correctly set date/time? (https://www.linuxquestions.org/questions/linux-general-1/how-to-correctly-set-date-time-131887/)

Jakerohs 01-05-2004 09:38 PM

How to correctly set date/time?
 
I hope this is the right forum...oh well here goes.

Problem: Linux displays a different time of day to Windows.

System setup: Mandrake 9.2/Gnome, Windows XP dual booted.

Example: If I boot into windows, the time is correctly displayed as 4pm. If I boot into Linux, the time is incorrectly displayed as 5am. If I adjust the time in Linux to the correct time, then Windows displays the wrong time when I switch back.

Is there any way to fix this? The time difference always seems to be 11 hours.

linuxbotx 01-05-2004 10:43 PM

What are you doing to set the time? Try this. Start KDE. Right click on the clock in the right lower corner. Click on Configure Clock, then click on Time Zone. Click on your correct time zone. This should fix it.

neo77777 01-05-2004 10:43 PM

you can use ntpd to poll internet time, there are numerous how-to and I believe you can find one at http://ww.tldp.org

Jakerohs 01-06-2004 01:36 AM

The time zone is set correctly. The problem seems to be linux reading / writing the the time at bootup/shutdown incorrectly or in a different format. I know how to change the time, but it doesn't get set correctly at startup.
I'll have a go at using ntpd at startup to set the time instead of reading from the motherboard. Thanks.

jc2it 01-06-2004 10:17 AM

Recently, I had quite an experience setting the time on a Slackware 4.0 box that does not have X installed. This required me to learn the CMI for changing the time.

You have two clocks in Linux a CMOS or Hardware Clock and a Clock that is provided by Linux. Your problem may stem from the two not being in sync. In Linux set the time either with the GUI or the Date command. Better yet use 'ntpdate' or 'netdate'. Search the web or your man pages on how to use them. Then use either the 'clock -w' or the 'hwclock' command (you will have one or the other) to set the CMOS clock from the Linux clock. This will sync the two clocks.

Also check 'ls -l /etc/localtime' to determine if the Timezone is set correctly in Linux.

jc2it :study:

beaucoup 01-08-2004 03:48 AM

It sounds to me as though Linux has been configured to assume that your hardware clock is in GMT, and then impose your selected timezone as an offset. Windows, on the other hand, is likely actually setting the hardware clock to the time in your current zone.

For dual boot systems, this latter configuration makes more sense. I believe that setting the clock with the "date" command and NOT using the --universal switch should achieve this, but I'm not able to try it out at the moment.

If you use ntpd, such an adjustment should be doable from within that package's configuration. I'm not terribly familiar with it, though.

-Andrew


All times are GMT -5. The time now is 03:19 AM.