Koozali.org: home of the SME Server

[SOLVED] Time is always eight hours off

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Time is always eight hours off
« Reply #15 on: February 07, 2009, 08:05:17 PM »
Did you perhaps say that your system clock uses UTC during installation and is your localtime perhaps differing 8 hours from UTC (http://en.wikipedia.org/wiki/List_of_time_zones)?

SME server assumes without asking that time is set to UTC. It's also designed to run 24x7, so the BIOS should rarely run.

Quote
I have the BIOS set up to start the machine up once a day at a certain time.

That's an unusual thing to do with SME server. Nevertheless if you wish to do that, you should set your "certain time" to a "certain time UTC".

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Time is always eight hours off
« Reply #16 on: February 07, 2009, 08:29:04 PM »
This is correct as I pull it out:

Date:  Sat Feb 7 11:23:01 PST 2009

And this is also correct:

hwclock:  Sat 07 Feb 2009 11:24:10 AM PST -0.191442 seconds

This is the result of ls -la /etc/localtime

lrwxrwxrwx  1 root root 41 Jan 11 02:31 /etc/localtime -> ../usr/share/zoneinfo/America/Los_Angeles


...

Did you perhaps say that your system clock uses UTC during installation and is your localtime perhaps differing 8 hours from UTC (http://en.wikipedia.org/wiki/List_of_time_zones)?

I don't recall one way or the other whether I selected any option for UTC or whether the option existed at all.

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Time is always eight hours off
« Reply #17 on: February 07, 2009, 08:31:57 PM »
SME server assumes without asking that time is set to UTC. It's also designed to run 24x7, so the BIOS should rarely run.

That's an unusual thing to do with SME server. Nevertheless if you wish to do that, you should set your "certain time" to a "certain time UTC".

I'm quite certain that the BIOS does not have the option to set the time for UTC.  I'll look again, but in all the many BIOS's I've seen I don't think I've ever seen that.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Time is always eight hours off
« Reply #18 on: February 08, 2009, 03:45:12 PM »
I'm quite certain that the BIOS does not have the option to set the time for UTC.  I'll look again, but in all the many BIOS's I've seen I don't think I've ever seen that.

I wasn't suggesting there was such a thing. If you wish to persist in setting a wake-up time, set the wake-up time to the time in London, UK you want the system to wake up, not Californian time.

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Time is always eight hours off
« Reply #19 on: February 08, 2009, 05:39:02 PM »
OK, but do I understand correctly that this is a workaround and not the expected functionality of SME?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Time is always eight hours off
« Reply #20 on: February 08, 2009, 05:46:07 PM »
OK, but do I understand correctly that this is a workaround and not the expected functionality of SME?

It's expected functionality of SME that the hardware clock will be set to UTC.

It's also expected that SME will run 24x7, and not be started/stopped at various times during the day.
 

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Time is always eight hours off
« Reply #21 on: February 08, 2009, 08:04:25 PM »
OK, understood.  Problem solved.

Offline electroman00

  • *****
  • 491
  • +0/-0
Re: Time is always eight hours off
« Reply #22 on: February 09, 2009, 09:49:39 PM »
Goto >> Date and time configuration and Disable Network Time Server.

Then enter your info and re-enable the time server.

hth

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Time is always eight hours off
« Reply #23 on: February 09, 2009, 10:17:43 PM »
Goto >> Date and time configuration and Disable Network Time Server.

Then enter your info and re-enable the time server.

hth

Why would I do this?

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Time is always eight hours off
« Reply #24 on: February 09, 2009, 10:32:27 PM »
I think electroman00 is pointing out the correct way to set the time zone before you turn on NTP. He is quoting from the manual.

You have hit on an interesting hardware/software time relationship that just has not come up before because "nobody??" else is using the bios settings to reboot their server.

If I understand correctly from the posts above, the system clock should be set to UTC/GMT which is PST/Los Angeles +8hrs. (the correct way to say this is that PST = UTC -8). This means that any Bios reboots will have to be calculated by taking the local time you want the system to reboot +8.

As you understand, you do not set which timezone the system is in on the hardware clock. Instead you set the hardware clock to the current UTC/GMT time. When you then set the timezone in SME, on bootup SME calculates the difference from UTC and sets the SOFTWARE clock to the correct LOCAL time. (in this case PST)


Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Time is always eight hours off
« Reply #25 on: February 09, 2009, 10:42:35 PM »
OK.  As far as I am concerned, no other discussion is necessary.  Until some new demand or observation be made regarding my system by me that comes up against the system clock, Problem Solved.

Offline electroman00

  • *****
  • 491
  • +0/-0
Re: Time is always eight hours off
« Reply #26 on: February 11, 2009, 08:11:45 PM »
Seem to be some confusion here.

I think electroman00 is pointing out the correct way to set the time zone before you turn on NTP. He is quoting from the manual.

It's in the manual but not in the wiki, which could lend itself to this type of issue expressed by the OP.

You have hit on an interesting hardware/software time relationship that just has not come up before because "nobody??" else is using the bios settings to reboot their server.

Rebooting is irrelevant to the issue here, correcting the date/time configuration solves the issue here and OP can reboot every minute if he wants.
Although it may not be wise to reboot every minute or every day for that matter, to each his own.

If I understand correctly from the posts above, the system clock should be set to UTC/GMT which is PST/Los Angeles +8hrs. (the correct way to say this is that PST = UTC -8).

The system clock will always be set to UTC and a software +/- offset based on your time zone to display to the user, the system clock is always maintained UTC on virtually all computer systems, thus the term Coordinated Universal Time UTC.

This means that any Bios reboots will have to be calculated by taking the local time you want the system to reboot +8.

When the time is updated the bios (hardware clock) will be updated to your time zone, not UTC, the bios clock knows nothing of time zones, never has and never will, it's superfluous code that isn't needed in the bios.
Most all time sync software will update the OS system clock (software clock) to UTC and the bios (hardware clock) to your time zone, sometimes the bios update is optional/configurable.
All NTP servers are UTC, thus your OS system clock (software clock) is updated to UTC as Charlie stated, then any software that displays the time must know the time zone your in to display it correctly.

Thus....
OS system clock (software clock) updated to UTC
and
Bios (hardware clock) updated to your time zone via the +/- TZ offset

To test the bios clock is updated, simply set the bios time incorrectly and run any time sync software, recheck the bios clock.
When you manually enter the bios time you should enter your time zone time, not UTC time.
But you really don't have to set it if your using a good time sync app.

As you understand, you do not set which timezone the system is in on the hardware clock. Instead you set the hardware clock to the current UTC/GMT time.

First read...http://en.wikipedia.org/wiki/Coordinated_Universal_Time

Incorrect....you set bios clock (hardware) to your time zone, since the bios doesn't know about TZ's and cannot adjust for them.

In fact you don't have to set the bios (hardware) clock, it will be updated by NTP service and set to your time zone via the closest UTC time server you choose, which may then be reported/displayed via some software app to the user as UTC adjusted for the user Time Zone.

Setting and Reading the OS system software clock are two different methods, always referenced to UTC.

When you then set the timezone in SME, on bootup SME calculates the difference from UTC and sets the SOFTWARE clock to the correct LOCAL time. (in this case PST)

OS system clock is always UTC and software app adjusted for time zone for display.

If it doesn't then there is likely a bug, hardware or software or last but not least a incorrect configuration, which is what we have here in the thread.

Computer systems don't care what time zone their in, so all time sensitive systems are synced to UTC so no time zone adjustment needs to be done to maintain/improve accuracy.
If systems needed to TZ calc then the time it takes to calc would need to be employed in the final time calc as a correction and each system runs at different speeds so their corrections would be different adding to inaccuracy.

Humans do care what time zone their in, so systems will usually always adjust for TZ via software, no big deal if it's off by a few milliseconds.

The entire GPS system for example uses UTC, synced from Atomic Clocks and corrected for many issues that occur within the system.
One example of a correction is the time it takes for the radio signal to travel 12,500 miles from earth to the satellite.

A millisecond error in the GPS world is thousands of feet of error in the final position calc.

The GPS system is time accuracy and measurement to the MAX and simple geometry.
Fortunately we don't have to get involved with such time accuracy with our systems.
Since most were asleep in geometry, we don't have to worry about that either, simply buy a GSP and you might know where you are.
Or for that matter where your going. :P

Go here http://www.n2yo.com/?k=20 and select a GPS satellite, make note of the altitude and speed and try to imagine the time accuracy you need to calc a 3 axis position within a few feet from 12,500 miles away.
Yup....you also get altitude above MSL (mean sea level).

Why is it only above MSL and not below MSL, radio signals do not traverse water (H2O).
So GPS is no help to a submerged submarine, they have to nav the old fashioned way, when submerged.

Thus a basic example for the use of UTC and the level of accuracy that may be needed within a system.

OK.  As far as I am concerned, no other discussion is necessary.  Until some new demand or observation be made regarding my system by me that comes up against the system clock, Problem Solved.

If it works for you it works for me, however it is the solution to your problem and misunderstanding.

And your welcome anyway, even if it won't help you, it may help others.

hth

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: [SOLVED] Time is always eight hours off
« Reply #27 on: February 11, 2009, 08:27:59 PM »
@LANMonkey,

I am sorry for using your thread for this discussion, however, It looks like I put two and two together and came up with six.


@electroman00,

Thanks for explaining my incorrect assumptions. I "think" I understand the relationship of hardware and software clocks now. I will do some more research.

« Last Edit: February 11, 2009, 08:35:44 PM by mercyh »

Offline electroman00

  • *****
  • 491
  • +0/-0
Re: [SOLVED] Time is always eight hours off
« Reply #28 on: February 11, 2009, 09:00:33 PM »
Your more then welcome, were all here to help each other.
Fortunately for you all two capacitors blew up on the video card that is in the system I was using to write the post, had to shut things down rather quickly, else the post might have gone on for days. :P

Yup....looks like ole faithful just got demoted.

Now I'm on the search in the shop to find two stinking caps, in a short period of time.
Were back to time again. :P
Days to find them in the shop and five minutes to solder them in, what a concept. :P