Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Gmt +1

Kittie Munro
Registered User
Join date: 28 May 2007
Posts: 29
03-30-2008 06:45
Hello everyone,
I've managed to make a lovely clock using some of the very clever scripts flying around, and I've even managed to make it run to GMT time!
Now the clocks have gone forward but my clock hasn't. I have a feeling that it never will since SL doesn't recognise BST, only GMT.

Is there an easy way to turn llGetGMTclock into llGetGMTclock +1hour?

many thanks :)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
03-30-2008 07:15
CODE
integer timezone = -5;//example = EST
integer dst = TRUE;

default
{
touch_start(integer total_number)
{
integer local_time = (integer)llGetGMTclock() + ((timezone + dst) * 3600);
integer hours = local_time / 3600;
integer minutes = (local_time % 3600) / 60;
integer seconds = local_time % 60;
llOwnerSay((string)hours + ":" + (string)minutes + ":" + (string)seconds);
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Kittie Munro
Registered User
Join date: 28 May 2007
Posts: 29
03-30-2008 08:30
Thank you Jesse :) You're a chronological wonder!
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
03-30-2008 15:49
From the Wiki: GMT time is very useful when synchronizing with systems outside of SL via email or RPC. It is an absolute and international measure of time that does not change throughout the year. It isn't so great when trying to make a wall clock for Second Life that observes Daylight Saving Time. Creating local time from this function is a matter of adding the correct offset to GMT, a requirement complicated by yearly and national differences of when Daylight Saving Time goes into and out of effect.

and: note by CeeqLaborde - I actually think this breaks bad when timezone takes the gmt time over 23:59:59

Another problem is, that with Jesse's script, you have to adjust the value for dst manually - which isn't _that_ handy and will most likely make your wallclock show the wrong time at the end of dst again (until you set dst to FALSE)...

I can't wait for the day when our politicians finally come to the conclusion that dst is crap and doesn't save _any_ energy (that was the purpose of this stupid idea). Au contraire - since we've got dst, energy consumption went up... but that's a different story :)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
03-30-2008 18:31
Yep, forgot to take into account > 24 or < 0:

Corrected:
CODE
integer timezone = -5;//example = EST
integer dst = TRUE;

default
{
touch_start(integer total_number)
{
integer local_time = (integer)llGetGMTclock() + ((timezone + dst) * 3600);
if(local_time > 86400)local_time -= 86400;
else if(local_time < 0)local_time += 86400;
integer hours = local_time / 3600;
integer minutes = (local_time % 3600) / 60;
integer seconds = local_time % 60;
llOwnerSay((string)hours + ":" + (string)minutes + ":" + (string)seconds);
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-30-2008 21:37
Let's not forget regions which have an extra HALF-hour time difference. Heh heh. :eek:
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
03-31-2008 11:03
From: Hewee Zetkin
Let's not forget regions which have an extra HALF-hour time difference. Heh heh. :eek:


or the ones that are +24 minutes too...

Which is why all my clocks at ClockWerks can be set to any time (yeah, blatent plug of my stuff !!!)