Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

getDaylightSaving()

Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-24-2003 21:50
Ty very much to Ama Omega for picking all the bugs outta this one for me :D
This function returns true if SL time is currently experiancing daylight saving time, false if other wise (note: SL time == PST)

Here it is:
CODE

integer getDaylightSaving() //returns TRUE if current date is withen daylight saving time.
{
list datesplit = llParseString2List(llGetDate(),["/"],[]); //mm/dd/yyyy
integer month = llList2Integer(datesplit,0);
integer day = llList2Integer(datesplit,1);
integer year = llList2Integer(datesplit,2);
if(month > 4 && month < 10) return TRUE;
else if(month < 3 || month > 10) return FALSE;
else if(month == 4)
{
if(day > 6) return TRUE;
if(getDay(llGetDate()) == "sunday") return TRUE;
else return FALSE;
}
else if (month == 10)
{
if(day > 26) return FALSE;
if(getDay(llGetDate()) == "sunday") return FALSE;
else return TRUE;
}
else return FALSE;
}


I would really like ppl to not use this in stuff they plan on selling, if you are... then, I wish I could say 'you must' post your code here. ::Wishes there were some sort of GNU private license of some sort that applys to SL scripts :(
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Bino Arbuckle
Registered User
Join date: 31 Dec 2002
Posts: 369
07-26-2003 17:24
I would suggest not posting it here, then. This forum is world-readable, so it is accessible by the public domain.

I did go back to see whether the initial post for this forum said anything regarding use. Unfortunately, it does not.

Lindens?