Tiny Core Base > TCB Q&A Forum

Computer time incorrect?

<< < (2/3) > >>

maro:
I believe if you add
    . /etc/sysconfig/timezone
    export TZ
    hwclock -ls
to '/opt/bootlocal.sh' you should have a workaround until the "proper fix" comes through.

Of course you can always re-master the initrd yourself (and then then possibly the ISO image, if you boot from CD-ROM).

jur:
With tc2.11rc1, the noutc boot code is working. But daylight savings time still eludes me.

--- Code: ---tc@box:~$ showbootcodes
quiet max_loop=255 tz=EST-10EST,M10.1.0/2,M4.1.0/2 noutc

--- End code ---
and

--- Code: ---tc@box:~$ showbootcodes
quiet max_loop=255 tz=EST-10EST,M10.1.0/2,M5.1.0/2 noutc

--- End code ---
give identical results. The second case, giving the instruction to change to winter time in month 5, still results in displayed time same as hwclock.

What is the code supposed to do during summer - add one hour to the hwclock value and display that?

maro:
@jur: At first I was also surprised about what you wrote, but I believe I've now got an explanation:

In your test the situation gets a bit muddled by the fact that the name for the standard time is in your case the same as Daylight Saving Time (i.e. EST-10EST). In my attempt to repeat your tests I took the liberty to use a different name for DST:

--- Code: ---tc@box:~$ showbootcodes ; date
quiet max_loop=255 tz=EST-10DST,M10.1.0/2,M4.1.0/2 noutc text
Thu Apr 22 11:16:27 EST 2010

--- End code ---
and

--- Code: ---tc@box:~$ showbootcodes ; date
quiet max_loop=255 tz=EST-10DST,M10.1.0/2,M5.1.0/2 noutc text
Thu Apr 22 11:16:42 DST 2010

--- End code ---
So at least this shows that the detection whether the current time is inside or outside of DST is working as expected.

Why are the times showing no difference (in local time)? Well, I guess it's due to boot code 'noutc' which "instructs" TC to use 'hwclock' for the local time. It then "calculates" out of this UTC time:

--- Code: ---tc@box:~$ showbootcodes ; TZ=UTC date
quiet max_loop=255 tz=EST-10DST,M10.1.0/2,M4.1.0/2 noutc text
Thu Apr 22 01:33:57 UTC 2010

--- End code ---
and

--- Code: ---tc@box:~$ showbootcodes ; TZ=UTC date
quiet max_loop=255 tz=EST-10DST,M10.1.0/2,M5.1.0/2 noutc text
Thu Apr 22 00:34:17 UTC 2010

--- End code ---
And there you'll now find a difference, and the latter one is "wrong". Please note that both times are incorrect as in my testing I did not fudge my own 'hwclock' and my local time zone is not EST. Nevertheless I strongly believe that this does not change the point I'm trying to make.

Another way to show the difference is to fetch the proper UTC time:

--- Code: ---tc@box:~$ showbootcodes ; getTime.sh
quiet max_loop=255 tz=EST-10DST,M10.1.0/2,M4.1.0/2 noutc text
Wed Apr 21 23:45:05 UTC 2010
Thu Apr 22 09:45:05 EST 2010

--- End code ---
and

--- Code: ---tc@box:~$ showbootcodes ; getTime.sh
quiet max_loop=255 tz=EST-10DST,M10.1.0/2,M5.1.0/2 noutc text
Wed Apr 21 23:45:14 UTC 2010
Thu Apr 22 10:45:14 DST 2010

--- End code ---
Now we "see" the 1 hour time difference you were after, and I believe that proves that the fix has worked as expected.

Finally in an attempt to answer your question re. "summer time" I'd like to quote from the manual: "... if the offset is omitted, it defaults to one hour ahead of standard time ..."

curaga:
Unix systems only do automatic DST when using UTC time in the bios clock. Otherwise it is presumed the bios clock is always in the proper time (ie. set by the user or a different system, like windows).

jur:
So am I correct in concluding from this, that with noutc, the TZ boot code is irrelevant, as the computer clock isn't adjusted by the OS when DST rolls by? That is, it will know when is DST but won't do anything to the clock.

Perhaps I have to cut this last apron string tying me to Windows and go UTC.  :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version