Set Time (for setting puppy's clock)

Core libraries and systems
Message
Author
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

Set Time (for setting puppy's clock)

#1 Post by MU »

Somewhere else in this board someone asked for it.

It is a modified sample from "xdialog".
The original produced several errors on puppy, for example setting the "--utc" -option and running hwclock in busybox.

Mark
Attachments
set-time-for-puppy.pup
(5.08 KiB) Downloaded 3666 times
Last edited by MU on Wed 02 Nov 2005, 11:17, edited 1 time in total.

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

#2 Post by Lobster »

Excellent - G2 did tell me how to do this from the command line but this is much easier
Hope Barry incorporates it into puppy - very tiny script

Thanks MU - can I call you 'M' for short?

:)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#3 Post by MU »

Lobster,

you can say "Mark" , M or MU as you like.
MU are just my initials (Mark Ulrich)

>Hope Barry incorporates it into puppy - very tiny script

Please check it first - I don't know exactly what this --utc -option is I threw out.
I hope this will not result in wrong timesettings in other countries.

Mark

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

#4 Post by Lobster »

Sorry forgot to mention Mark
- it works on my machine

My clock has been 1 hour back for ages and ran your program and it seemed to work OK - rebooted and still OK (in fact turned off machine - time is still OK)

- does it work on the BIOS?
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

PeterSieg
Posts: 363
Joined: Wed 04 May 2005, 16:06
Location: Germany, 37603
Contact:

Just tested - seems to work ok for me..

#5 Post by PeterSieg »

set date+time util works. Great!

"Gute Arbeit, MU"

PS
Have fun :)

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#6 Post by MU »

I think so, "hwclock" should mean "HardWare-Clock".

If you type "man hwclock" you will get a closer explanation of the mechanism.

The script uses
hwclock --set --date="9/6/2005 10:12:56"
(sets the hardwareclock)
and then
hwclock --hctosys
(sets the systemtime from the hardwareclock)

Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#7 Post by MU »

Danke Peter,

Dich kenn ich doch aus dem wxBasic-Board? :-)

Gr

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

#8 Post by GuestToo »

--utc probably sets your clock to utc (gmt)

Windows boxes usually have the hardware clock set to local time, not utc, so probably most Puppy users would be using local time, not utc

i have a program that sets the clock automatically from the internet, but it requires that you set the time zone correctly (there is 1 correct setting and 23 wrong time zone settings ... Barry's time zone wizard works fine, it's just that the sign is backwards ... so if your time zone is EST, the offset is +5 not -5, and so on)

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#9 Post by edoc »

GuestToo wrote: i have a program that sets the clock automatically from the internet, but it requires that you set the time zone correctly (there is 1 correct setting and 23 wrong time zone settings ... Barry's time zone wizard works fine, it's just that the sign is backwards ... so if your time zone is EST, the offset is +5 not -5, and so on)
I have tried both clicking on the blank desktop, selecting Programs, Control Panel, Set Time Zone (which acts as though it is doing something but does not), and the same sequence ending with Set Time/Date (which does not provide any option to actually set anything), and your app which provides for setting zone, date, and time but I can never get it right. The actual change in increments is minutes even when I change from +5 to -4 hours.

I am in EST and I currently see 18:30 in the bottom right corner.

What date and time stamp do you see on my post, please?

Thanks! doc
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#10 Post by MU »

I see:

Posted: Tue Sep 13, 2005 9:56 am Post subject:

All times are GMT - 4 Hours

I really don't have an idea :(

Here it sets the time correct (Germany, Berlin)

Mark

Guest

#11 Post by Guest »


User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#12 Post by edoc »

Anonymous wrote:don't know if this help:
http://www.goosee.com/puppy/wikka/TimeZone

Now I get it!

For Puppy one ignores the usual -5 for NY and enters 0

That gets the correct time.

Thanks! doc
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

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

#13 Post by GuestToo »

edoc, if you are in west central florida, that would be the EST/EDT time zone

my time zone is also EST

what i do is run the Puppy Time Zone Wizard and click the +5 button

yes, the wizard says EST is -5, but that's wrong ... the correct offset is +5

then i edit /etc/TZ and change UTC+5 to EST5EDT ... which works the same, it's the 5 that sets the time zone

the time zone should be correct when you reboot
if the time is wrong, it's because the hardware clock is set to the wrong time

you can set the clock from the internet ... i have a dotpup package that does this

get the time from the internet:
(this does not set anything, it just shows what time it is according to your time zone settings ... if your time zone settings are right, it will show the correct time)
rdate -p time.nist.gov

print the system time and date:
date

print the time the hardware clock is set to:
hwclock --show

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#14 Post by edoc »

GuestToo wrote:you can set the clock from the internet ... i have a dotpup package that does this
For some reason neither of my laptops react properly to the Internet Time app but I have found that the set-time-for-puppy.pup app does work on both.

Very odd but problem has now been solved here.

Thanks! doc
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#15 Post by edoc »

edoc wrote:Very odd but problem has now been solved here.
I am being told that my time stamp is showing up on lists incorrectly.
I tried this:

# echo $TZ?

And got:

UTC-0?

It should UTC-4 in the Eastern time zone but shows British time instead.

Problem is that the clock in the lower right of the display shows the correct time.

I am running stock Mozilla suite.

How can this be, please?

Thanks! doc
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

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

#16 Post by GuestToo »

How can this be, please?
you have your timezone set wrong
it will not work properly if it is set wrong

click Set Time Zone in the Control Panel menu
click the +4 button
edit /etc/TZ and change UTC+4 to EST5EDT

your time zone should be set correctly now
you will probably have to set your time zone to +5 when you go back to Standard Time

it would probably be a good idea to reboot after setting the time zone

after you set the time zone correctly, if the clock is wrong, it's because the clock is set wrong ... set the clock and it should be ok

if you go to: http://andrewu.co.uk/clj/timezone/
it should show you that everything is set properly

the UTC time should be the correct UTC time
you can get the correct UTC time here
(scroll down a bit)
it should also tell you the correct local time in Florida
all the information on the andrewu site should be correct

also, if your time zone is set correctly, you can type
rdate -p time.nist.gov
and it will print the correct time ... if it doesn't, it's because your time zone is wrong

you could put echo EST5EDT > /etc/TZ in rc.local and if Puppy changes TZ behind your back, it will be set to EST5EDT again the next time you boot

i know the Puppy Time Zone Wizard says EST - New York City is -5 ... but it's not ... it's wrong ... see the man pages for hwclock and tzset
The offset string ... specifies the time value to be added to the local time to get Coordinated Universal Time (UTC). The offset is positive if the local time zone is west of the Prime Meridian and negative if it is east

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#17 Post by BarryK »

i have a program that sets the clock automatically from the internet, but it requires that you set the time zone correctly (there is 1 correct setting and 23 wrong time zone settings ... Barry's time zone wizard works fine, it's just that the sign is backwards ... so if your time zone is EST, the offset is +5 not -5, and so on)
GuestToo,
which one is correct?

Also, see the News page for 23rd September.

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

#18 Post by GuestToo »

for Puppy 1.0.5rc, my timezone seems to be correct if /etc/TZ is EST5EDT and /etc/localtime is symlinked to GMT+4

i will probably have to change the timezone to +5 in October

EST5EDT is definitely correct for my timezone
because it's daylight-saving time, it is using the EDT part, so date prints EDT as my timezone ... the letters are not important, the offset number is important ... when it uses EDT it is using an offset of +4 ... in other words, EST5EDT during daylight saving time is the same as UTC+4 ... EST5EDT during standard time is the same as UTC+5 ... the thing about EST5EDT is it should automatically change the time by 1 hour when daylight saving time ends in October

time stuff can get awfully complicated and confusing ... partly because there are so many zones with different (arbitrary and politically created rules)

another thing that is confusing is that the time displayed will change if you change any of the time configurations ... for example, change TZ, the symlink to localtime, the hardware clock setting, the UTC variable, and they will all change the clock display

using UTC=1 is easier ... but if you dual-boot Windows, it wants the hardware clock to be set to local time ... and it will usually automatically reset time that the hardware clock is set to for daylight saving time ... so Linux usually does not try to change the hardware clock setting too, or it would cause problems ... if you dual boot Linux and Windows, then Windows should probably reset the hardware clock for daylight savings ... if you run only Linux, then you will probably need to reset the time zone twice a year

rdate seems to work properly only if you set the timezone correctly ... it's working properly now on my machine with TZ=EST5EDT and localtime symlinked to GMT+4 ... Tor also seems happy ... it prints error messages if your clock is not set properly

one thing that i am certain of ... EST5EDT is the correct TZ for my timezone ... so that makes it easier to get the other setttings right

UTC=1 is a lot easier ... you just set the hardware clock to UTC and set TZ to display the correct local time ... but Windows doesn't like UTC

it's not rocket science, but it's complicated enough ... where's the aspirins?

User avatar
dewdrop
Posts: 298
Joined: Tue 30 Aug 2005, 01:54
Location: Texas USA

Time

#19 Post by dewdrop »

Edoc,

I see your post as saying it was posted at
Posted: Tue Sep 13, 2005 9:12 am Post subject:

Dewdrop
edoc wrote:
GuestToo wrote:
I am in EST and I currently see 18:30 in the bottom right corner.

What date and time stamp do you see on my post, please?

Thanks! doc

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

#20 Post by GuestToo »

i think the dates on files are set according the how the kernel clock is configured, which is different from the system clock and from the hardware clock ... apparently, the kernel clock is set by hwclock when it sets the system clock from the hardware clock

all i know, is that some programs are unhappy with the way Puppy's Time Zone wizard sets things, but they seem to be relatively happy if you reverse the sign of the offset ... i've tested it for my time zone and few other time zones i'm familar with and it seems to work ok with all of them

i'm not totally sure how the daylight saving shift works with Puppy ... i think if you use local time, the system is assuming you are dual-booting with Windows and that Windows is going to reset the hardware clock by 1 hour, and behaves accordingly

Post Reply