LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   12 and 24 hour clock timings -- arggh! (https://www.linuxquestions.org/questions/linux-general-1/12-and-24-hour-clock-timings-arggh-152446/)

Jim Miller 03-01-2004 10:10 PM

12 and 24 hour clock timings -- arggh!
 
A probably blindingly-obvious question, but its answer continues to escape me: I have two x86 boxes both running virtually identical versions of RedHat 9. Unfortunately, one of these machines is not successfully working with my backup system (Dantz Retrospect), while the other one works fine. I've narrowed it down to the following situation:

GoodMachine: hwclock --debug
hwclock from util-linux-2.11y
Using /dev/rtc interface to clock.
Last drift adjustment done at 1077909647 seconds after 1969
Last calibration done at 1077909647 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2004/03/01 19:51:14
Hw clock time : 2004/03/01 19:51:14 = 1078199474 seconds since 1969
Mon Mar 1 19:51:14 2004 -0.813675 seconds

BadMachine: hwclock --debug
hwclock from util-linux-2.11y
Using /dev/rtc interface to clock.
Last drift adjustment done at 1078199348 seconds after 1969
Last calibration done at 1078199348 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2004/03/01 19:50:48
Hw clock time : 2004/03/01 19:50:48 = 1078199448 seconds since 1969
Mon 01 Mar 2004 07:50:48 PM PST -0.295439 seconds

The difference, of course, is in the last lines of the output, which show that GoodMachine is in one situation, while BadMachine is in the other. I'm assuming that this is because of something I did to BadMachine at some time in the past, and that if I can get BadMachine's hardware clock into the same state as GoodMachine, my problems will go away. But, so far, I haven't found the magic incantation. Can anyone help with this? As I said, it's probably bleeding obvious, but I just haven't been able to find it.

It may be worth mentioning that I also have a Windows ME partition on this machine, so Windows has occasionally gotten its hands on the clock...

Thanks,
Jim

witeshark 03-01-2004 11:23 PM

Hw clock time : 2004/03/01 19:51:14 = 1078199474 seconds since 1969
Mon Mar 1 19:51:14 2004 -0.813675 seconds
Hw clock time : 2004/03/01 19:50:48 = 1078199448 seconds since 1969
Mon 01 Mar 2004 07:50:48 PM PST -0.295439 seconds
The good machine is showing output in European 24 hour (purple) and the other in 12 hour (green) it seems the back up system relies on the 24 hour format to time backups.

Jim Miller 03-01-2004 11:37 PM

Quote:

Originally posted by witeshark
...The good machine is showing output in European 24 hour (purple) and the other in 12 hour (green) it seems the back up system relies on the 24 hour format to time backups.[/color] [/B]
I agree(!). So, how do I get BadMachine to use 24 hour time?

witeshark 03-01-2004 11:44 PM

Quote:

Originally posted by Jim Miller
I agree(!). So, how do I get BadMachine to use 24 hour time?
There is certainly a way to get the second machine set to Military/24 hour clock, that work as a start.

Jim Miller 03-01-2004 11:49 PM

So, what >>is<< that way????

witeshark 03-02-2004 12:35 PM

Quote:

Originally posted by Jim Miller
So, what >>is<< that way????
It depends on the machine, on some it's in system preferences. Or it may be possible to click on the clock and find options there.

JaseP 03-02-2004 03:30 PM

My understanding with the clock in the menu bar is that it just re-interpolates the time in the system or bios clock, and that the bios clock is always a 24 hour clock...

Boot the machine up fresh and enter the bios,... maybe I'm wrong here. Maybe the bios can be set to 12 hr time versus 24 hr time.

Then again, Linux can do a time offset based upon where you are located if the bios clock is set to GMT.

Jim Miller 03-02-2004 11:23 PM

I've been in the BIOS, and there is nothing regarding the clock other than setting its time and date -- no timezone stuff, no 12/24 choices.

Sheesh...

Thanks,
Jim

witeshark 03-02-2004 11:30 PM

What is your box? This is what I need to give a useful answer.

tearinox 03-02-2004 11:31 PM

Well, I know in my fluxbox setup, I had to just change some stuff in the ~/init directory to change the systembars clock setup.

Whatever program is displaying the clock or w/e, just read the manual and find out =P

witeshark 03-02-2004 11:42 PM

well this is what I am saying -- it's a box hardware setting and DONE - all fixed

gnuzilla 07-17-2007 05:31 PM

the bios is always in 24/ hour format
 
the bios is always in 24/ hour format....period

XavierP 07-17-2007 06:19 PM

I'm surprised you found this, the post prior to yours was 3 years ago.

jlliagre 07-17-2007 06:54 PM

hwclock uses strftime "%c" format to display the date.

From strftime manual page ( http://man.linuxquestions.org/index....ction=0&type=2 )

%c means "The preferred date and time representation for the current locale."

The locale must be different between the environments.

Check LC_DATE, LC_ALL or similar variables.

I'm surprised your locale could be a H/W setting on your machines.


All times are GMT -5. The time now is 08:53 PM.