Then the Wiki went offline.. took forever to come back. It's back up now. The correction and my post didn't make it over to the new site.
So I'd like to post the correction again (I was pointing out a bug in the script that should be fixed) however I find no way to log in at this new site, and it will not accept any posts without me being first logged in.
So, is there any way to get this fixed?
Currently the script contains this function
CODE
// Return number of days since 2000-01-01
integer datestamp(integer year, integer month, integer day){
year = year - 2000;
list monthdays = [0,31,28,31,30,31,30,31,31,30,31,30,31];
integer i=1;
integer sum = year * 365 + (year/4) + day;
for(i=1;i<month;i++){
if( (month != 2) || (year % 4 != 0)){
sum+=llList2Integer(monthdays,month);
}else if(month == 2){
sum+=29;
}
}
if(year % 4 == 0){
return sum - 1;
}
return sum;
}
I draw your attention to the for loop:
CODE
for(i=1;i<month;i++){
if( (month != 2) || (year % 4 != 0)){
sum+=llList2Integer(monthdays,month);
}else if(month == 2){
sum+=29;
}
}
You start off by initiating 'i' to 1, and increment it on each itteration. however in the line:
sum+=llList2Integer(monthdays,month);
You fail to use the 'i' where it is needed. You're adding the same number of days every iteration.
That should be changed to
sum+=llList2Integer(monthdays,i);
It's a simple mistake, but one I fear most people will not notice.
So if someone who can change that, please do so, and if it is somehow possible for me to post the correction on that site itself instead, then please tell me how.
Thank you