Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 27 Aug 2014, 23:28
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to set Puppy to adjust for daylight saving time?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [11 Posts]  
Author Message
eMeRy


Joined: 22 Jan 2006
Posts: 86
Location: Hungary,Europe

PostPosted: Mon 27 Mar 2006, 15:08    Post subject:  How to set Puppy to adjust for daylight saving time?  

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?
Question
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Tue 28 Mar 2006, 04:23    Post subject:  

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
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 28 Mar 2006, 05:47    Post subject:  

Would changing the time in the bios also work?
_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Tue 28 Mar 2006, 06:15    Post subject:  

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
Back to top
View user's profile Send private message 
eMeRy


Joined: 22 Jan 2006
Posts: 86
Location: Hungary,Europe

PostPosted: Tue 28 Mar 2006, 13:54    Post subject:  

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:
Quote:
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.)
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Wed 29 Mar 2006, 04:55    Post subject:  

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
Back to top
View user's profile Send private message 
eMeRy


Joined: 22 Jan 2006
Posts: 86
Location: Hungary,Europe

PostPosted: Wed 29 Mar 2006, 13:31    Post subject:  

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.
Sad
Back to top
View user's profile Send private message 
hwti

Joined: 16 Feb 2007
Posts: 2

PostPosted: Tue 15 May 2007, 10:02    Post subject:  

Here is what I did:

In /etc/rc.d/rc.local0, change
Code:
hwclock --hctosys --localtime

to
Code:
export UTC=true
hwclock --hctosys --utc


In /etc/profile, comment the 2 lines
Code:
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
Back to top
View user's profile Send private message 
Getnikar


Joined: 16 Jun 2006
Posts: 143
Location: Gold Coast, Australia

PostPosted: Sat 19 May 2007, 20:48    Post subject:  

(Deleted by poster)
Last edited by Getnikar on Sat 19 May 2007, 22:21; edited 1 time in total
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Sat 19 May 2007, 21:29    Post subject:  

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
Back to top
View user's profile Send private message 
RogerWilco

Joined: 05 Feb 2008
Posts: 1

PostPosted: Tue 05 Feb 2008, 19:29    Post subject: Kernel time is incorrect  

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!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [11 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0863s ][ Queries: 11 (0.0161s) ][ GZIP on ]