true full working release
This commit is contained in:
@@ -26,7 +26,7 @@ local function sca_setup_timezone()
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (daysPastUnixYear > 364) do
|
while (daysPastUnixYear > 364) do
|
||||||
if (year % 4 == 0 && (year % 400 == 0 && year % 100 != 0)) then
|
if (year % 4 == 0 || (year % 400 == 0 && year % 100 != 0)) then
|
||||||
daysPastUnixYear = daysPastUnixYear - 366
|
daysPastUnixYear = daysPastUnixYear - 366
|
||||||
else
|
else
|
||||||
daysPastUnixYear = daysPastUnixYear - 365
|
daysPastUnixYear = daysPastUnixYear - 365
|
||||||
@@ -35,15 +35,15 @@ local function sca_setup_timezone()
|
|||||||
end
|
end
|
||||||
|
|
||||||
for i = 0, 11, 1 do
|
for i = 0, 11, 1 do
|
||||||
if (daysPastUnixYear - daysPerMonth[i] >= daysPerMonth[i]) then
|
if (daysPastUnixYear - daysPerMonth[i] > daysPerMonth[i]) then
|
||||||
if (i == 2 && (year % 4 == 0 && (year % 400 == 0 && year % 100 != 0))) then
|
if (i == 2 && (year % 4 == 0 || (year % 400 == 0 && year % 100 != 0))) then
|
||||||
daysPastUnixYear = daysPastUnixYear - (daysPerMonth[i] + 1)
|
daysPastUnixYear = daysPastUnixYear - (daysPerMonth[i] + 1)
|
||||||
else
|
else
|
||||||
daysPastUnixYear = daysPastUnixYear - daysPerMonth[i]
|
daysPastUnixYear = daysPastUnixYear - daysPerMonth[i]
|
||||||
end
|
end
|
||||||
month = month + 1
|
month = month + 1
|
||||||
else
|
else
|
||||||
day = daysPastUnixYear - 1
|
day = daysPastUnixYear
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -53,15 +53,15 @@ local function sca_setup_timezone()
|
|||||||
if (month > 2 && month < 9) then
|
if (month > 2 && month < 9) then
|
||||||
summerTime = true
|
summerTime = true
|
||||||
elseif (month == 2) then
|
elseif (month == 2) then
|
||||||
// If its less than 6 days until end of the month (aka last Weekday in the month) and its sunday and its 3 am or later....
|
// If its less than 6 days until end of the month (aka last Weekday in the month) and its sunday and its 1 am UTC or later....
|
||||||
if ((daysPerMonth[month] - day <= 6) && weekDay == 3 && hoursInSeconds >= 7200) then
|
if ((daysPerMonth[month] - day <= 7) && weekDay == 3 && hoursInSeconds >= 3600) then
|
||||||
summerTime = true
|
summerTime = true
|
||||||
else
|
else
|
||||||
summerTime = false
|
summerTime = false
|
||||||
end
|
end
|
||||||
elseif (month == 9) then
|
elseif (month == 9) then
|
||||||
// The same action again but for winter time
|
// The same action again but for winter time
|
||||||
if ((daysPerMonth[month] - day <= 6) && weekDay == 3 && hoursInSeconds >= 10800) then
|
if ((daysPerMonth[month] - day <= 7) && weekDay == 3 && hoursInSeconds >= 3600) then
|
||||||
summerTime = false
|
summerTime = false
|
||||||
else
|
else
|
||||||
summerTime = true
|
summerTime = true
|
||||||
|
|||||||
Reference in New Issue
Block a user