How to set Puppy to adjust for daylight saving time?

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
eMeRy
Posts: 86
Joined: Sun 22 Jan 2006, 20:22
Location: Hungary,Europe

How to set Puppy to adjust for daylight saving time?

#1 Post by eMeRy »

Last weekend we had to set ahead our clocks with one hour in Europe because the daylight saving time has started.
My computer is free of Windows but has few linux distros so bios/hardware time is set to UTC. Puppy is installed on hd, option2.

It seems Puppy's clock doesn't follow the daylight saving time.

My settings:
TZ: CET-1
@localtime: /usr/share/zoneinfo/GMT+1

It was correct in standard time.

Beyond that I should set it manually, is there any tweak that makes puppy to set the system clock automatically?
:?:

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

Puppy uses localtime rather than utc because Puppy assumes that it will often be running on a machine that also has Windows installed, and Windows is not happy with utc ... it sets the hardware clock to localtime

when linux uses localtime, it assumes that Windows is also installed, which will probably automatically reset the hardware clock when daylight saving time changes ... so linux leaves the hardware clock alone

usually, if you only have linux installed, the hardware clock is set to utc and if the timezone is configured properly, the time should display correctly when daylight saving time changes

to setup Puppy to use utc rather than localtime, you would probably edit /etc/rc.d/rc.local0 and change

hwclock --hctosys --localtime

to something like:

export UTC=true
hwclock --hctosys --utc

you would probably need to edit rc.local0 again if you upgrade Puppy

you probably should change /etc/rc.d/rc.sysinit-cd too (if you run Puppy as a multi-session cd), but i think you would have to remaster Puppy to do that

if you configure Puppy to your timezone, and set the hardware clock properly to utc, then it should work properly (after a reboot)

something like this might work to set the hardware clock to utc from an internet time server:

TZ=UTC
rdate -s time.nist.gov
hwclock --systohc --utc

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

Would changing the time in the bios also work?
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#4 Post by GuestToo »

basically, the idea with using utc is that you set the bios's hardware clock once to utc ... and you never have to reset the bios clock again (except for drift errors because the clocks don't keep perfect time, especially when they are running off the battery when the computer is switched off)

if you set the bios's hardware clock to localtime, you have to reset the clock twice a year if you have daylight saving time ... because your local time changes twice a year

the main problem is that Windows has a cruder method for keeping it's system time than linux does ... and since Windows only uses localtime, and thus is forced to reset the bios's hardware clock twice a year, Linux (and Puppy) has to live with it if Windows is also installed ... see, for example:
http://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html

this is also interesting ... an interview with the maintainer of hwclock:
http://linuxgazette.net/issue73/tag/1.html

User avatar
eMeRy
Posts: 86
Joined: Sun 22 Jan 2006, 20:22
Location: Hungary,Europe

#5 Post by eMeRy »

GuestToo, thanks for your comment.
Yesterday I had a google-tour. I learned lot of useful details about DST. I recognised that TZ=CEST should work (It means UTC+1 or +2 depends on the current date. UTC+1 in standard time, UTC+2 in DST and should set the clock automatically.). I understand and accept that puppy haven't prepared to such terms like CET/CEST. But as I know puppy ignores any letters from TZ variable. (This variable was PUP-8 originally, as I right.) So puppy only use the time stamp which follows the letters (for me -1 and -2) and set the localtime from UTC with it.

I studied debian settings which works fine. There's no TZ variable only a localtime link which containes more info than puppy's linked file in /usr/share/zoneinfo/ folder. Debian surely handles different way system time than puppy.

GuestToo wrote:
usually, if you only have linux installed, the hardware clock is set to utc and if the timezone is configured properly, the time should display correctly when daylight saving time changes
What is the proper configuration in puppy?

BTW. after hd install I changed this line in rc.local0 script:

hwclock --localtime
to
hwclock --hctosys --utc

Should the 'export UTC=true' additional line solve my DST setting matter?

Anyway, temporarily I modified TZ to CEST-2 which led puppy showing the correct localtime. Maybe in October I have to change it back to CET-1.
As a matter of fact I don't mind it.
(The CET/CEST figure is only eye-candy: this way 'date' gives correct suffix after the numbers.)

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#6 Post by GuestToo »

i think you have to set the hardware clock to utc for Puppy to automatically deal with daylight saving time ... i think when the hardware clock is set to local time, it assumes that Windows will reset the hardware clock to deal with the daylight saving change

i put EST5EDT in my /etc/TZ file ... this should show that my time zone is EST or EDT (Eastern Standard Time ... Eastern Daylight Time) and should set the time zone to 5 or to 4 (or -5 or -4, depending how you think about it)

but for this to work automatically, i think i have to be using utc ... if i am using local time, the hardware clock would have to be reset twice a year ... linux usually expects Windows to do that

if you set it to use utc, i think if you put something like CEST-2CEDT in /etc/TZ, it might work properly ... or maybe CEST-2CEDT-1

Puppy does not have all the time zone programs and databases that other more-complete distros have, but i think if you configure things properly, maybe it will work the way you want it to ... though the GMT+2 file might change to daylight saving time on a different date than you expect

i think you have to set UTC=true if you want to use utc, or the system will assume you have the hardware clock set to local time

User avatar
eMeRy
Posts: 86
Joined: Sun 22 Jan 2006, 20:22
Location: Hungary,Europe

#7 Post by eMeRy »

My hardware clock already has been set to UTC.

I put the 'export UTC=true' line to rc.local0, changed TZ to CET-1, CEST-1, CET-1CEST, CET-1CEST-2, then EST-1EDT with no success. But EST-2, XYZ-2 or 'any letters'-2 gives correct system time. (I mean the time jwm shows in the panel)

I deleted the 'quiet' sign from grub to follow more details at boot time. After it, during boot, there wasn't any line on the screen about that puppy sets the clock.

Anyway, I'll go back to CEST-2 in /etc/TZ file till last Sunday of October.
:(

hwti
Posts: 2
Joined: Fri 16 Feb 2007, 15:19

#8 Post by hwti »

Here is what I did:

In /etc/rc.d/rc.local0, change

Code: Select all

hwclock --hctosys --localtime
to

Code: Select all

export UTC=true
hwclock --hctosys --utc
In /etc/profile, comment the 2 lines

Code: Select all

TZ=...
export TZ
Without these lines, the TZ variable won't be defined, so /etc/localtime will be used

Get a zoneinfo file from another distribution. I used one from FC6 (tzdata RPM) and it seems to work with no problem.
Copy it in /usr/share/zoneinfo and update /etc/localtime to point to it

User avatar
Getnikar
Posts: 143
Joined: Sat 17 Jun 2006, 02:34
Location: Gold Coast, Australia

#9 Post by Getnikar »

(Deleted by poster)
Last edited by Getnikar on Sun 20 May 2007, 02:21, edited 1 time in total.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#10 Post by GuestToo »

i don't think the Puppy GMT files automatically change when daylight saving time changes ... and they've changed the daylight saving rules recently anyway

RogerWilco
Posts: 1
Joined: Tue 05 Feb 2008, 23:10

Kernel time is incorrect

#11 Post by RogerWilco »

Hello all,
I didn't think I should start a new thread for this, so hopefully someone will take a look..

I'm running Puppy 3.01 and I am having difficulties with date, hwclock, and timezones.

I know that puppy sets hwclock using "hwclock --hctosys --localtime" in the /etc/rc.d/rc.country file.

With this command I have the system and hardware clocks showing the same time. The only problem is that the kernel seems to be showing a time 8 hours in the future. I figure it is reading my timezone setting /etc/localtime -> /usr/share/zoneinfo/Pacific and offsetting the system time by 8 hours.

I have been working on this for hours and I cannot find a way to get all of the times to sync unless I set the timezone to GMT-0. When i am set this way I can get the system, hw, and kernel time to all match up.

The reason I need the kernel time to match is because I am running some cron jobs once a day, and they won't run at the appropriate times with this kernel time offset.

Does anyone have any idea what I am doing wrong?

Thanks!

Post Reply