time is wrong, despite time zone set via tzconfig
Forum: DSL Embedded
Topic: time is wrong, despite time zone set via tzconfig
started by: robertakit
Posted by Guest on June 21 2007,18:51I finally discovered that my system was using EDT (Eastern Daylight Time) rather than my current time zone (PDT).
I used "tzconfig" to fix it and added etc/localtime to my .filetool.lst file. Now, whenever it boots, the time is incorrect -- it's 3 hours too early.
Is there an easy way to repair/fix this?
Posted by roberts on June 21 2007,19:19Don't need to run that or save that file. Instead use boot code:
If you have net access use the command
$ sudo gettime.lua
to set time from time server.
If you normally boot with net access then add gettime.lua to /opt/bootlocal.sh like this
Then upon boot I have accurate time set.
Posted by Guest on June 21 2007,20:13[quote=roberts,June 21 2007,15:19][/quote]
The boot code didn't work, but the gettime.lua trick does.
Posted by roberts on June 21 2007,22:31All of my frugal installed machines use such boot code in the grub menu. The boot code existed before the gettime.lua code.
Posted by Guest on June 21 2007,22:37Ah, I don't use grub. Perhaps that's the problem. I just use QEMU to boot directly into DSL.
Posted by roberts on June 22 2007,00:26Ah, perhaps it is the special character "/" that the bat file doesn't like. My windows aren't big enough to really run Qemu well. Maybe if you escape it?
Posted by Guest on June 22 2007,00:33I don't think that's the problem. When it actually comes up, and I type date, it correctly says PDT. So, it's catching the right stuff. It's just that the time is wrong.
Perhaps QEMU is not catching the fact that the host (Windows XP) is in the PDT time zone. Or something like that. Anyway, it's exactly 3 hours off, which makes me think that something thinks that I'm on the east coast :-).
Posted by Juanito on June 22 2007,09:58I've been struggling with the logic of this for a while now:
But, when I try and enter the correct time zone:
We could save 5,862 bytes in DSL by deleting tzselect...
Finally, if I load libc6, I get this:
Needless to say, if my timezone is GMT+4, the local time should be 13:49...
Posted by roberts on June 22 2007,14:26The offset method as you are trying to use is not supported in DSL.
Witness the fact, that to include all possible zoneinfo, as in Knoppix 3.4 is 1.6MB versus the limited zoneinfo by named zones is only 43k in DSL.
We have had the debate about which method to use in the past. In fact DSL originally only had EDT timezone. Later, I added in the US timezones. And finally the DSL community suggested that I at least add the named zones as specifically specified within knoppix-autoconfg boot options. This explains the what and why of DSL timezones. You can see such zones available by perusing /usr/share/zoneinfo/
Perhaps an extension could be made from the original Knoppix /usr/share/zoneinfo, but it would need to be the complement otherwise it would overwrite the new daylight saving time rules which are in DSL.
Posted by ^thehatsrule^ on June 27 2007,02:25robertakit: I noticed from your other thread that you were using qemu with -localtime AND using tz= ... perhaps only using either one will solve your problem
Posted by Juanito on Sep. 24 2007,14:08
- I just tried this by copying over the contents of /usr/share/zoneinfo, /usr/bin/tzselect and /usr/sbin/tzconfig from the knoppix iso.
I tried the boot code tz=Etc/GMT+4 but that didn't work (stays at EDT). Using tzconfig and GMT+4 gave UTC as 4 hours ahead rather than 4 hours behind. Using tzconfig and Moscow (in the same timezone) gave local time as 4 hours ahead and UTC as 8 hours ahead.
There must be another file(s) I'm missing?
Posted by jpeters on Sep. 25 2007,06:44
It's interesting to also load < www.time.gov > and watch just how accurate the clock is....i'm impressed.