Clock Widget - adjust time?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sims
Posts: 43
Joined: Wed Apr 12, 2006 5:36 pm

Clock Widget - adjust time?

Post by sims » Tue Jun 07, 2016 4:26 pm

Playing with LC 8.0.2

Clock Widget is off by one hour.
Do such widgets have any means to adjust them?

sims

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Clock Widget - adjust time?

Post by bn » Tue Jun 07, 2016 6:01 pm

Hi Jim,

either choose the Properties Inspector and choose a timezone that reflects your timezone plus daylight saving if applicable

For me living in UTC + 1 + daylight saving = UTC + 2

or use a script

Code: Select all

on mouseUp
   put the last word of the internet date into tTime -- something like "+0200"
   put tTime * 36 into tOffset -- to get to the seconds offset from UTC
   set the timeZone of widget "Clock" to tOffset
end mouseUp
internet date has the current offset from UTC for your system clock, including daylight saving if in effect.

Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Clock Widget - adjust time?

Post by bn » Tue Jun 07, 2016 9:09 pm

This corrects for time zones that have additional 30 minutes offset from UTC

Code: Select all

on mouseUp
   put the last word of the internet date into tTime -- something like "+0200"
   if char - 2 of tTime = 3 then put 5 into char - 2 of tTime -- catch half hour offset like India, New Territories AUS
   put tTime * 36 into tOffset -- to get to the seconds offset from UTC
   set the timeZone of widget "Clock" to tOffset
end mouseUp
Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Clock Widget - adjust time?

Post by bn » Wed Jun 08, 2016 10:41 pm

Hi Jim,

atually there are some bugs in the Clock widget. That is why the local time is not settable as it should.

http://quality.livecode.com/show_bug.cgi?id=17373

I hope that it will be fixed soon.

But with the workaround above it works right now.

Kind regards
Bernd

Post Reply