Thanks, I choose to use the one of admin and changed it a little, so he calculates the different between today and the set day.
But both thanks for helping me.
But both thanks for helping me.
Code:
now = os.date('*t')
eday = now.day
emonth = now.month
eyear = now.year
-- bevrijdingsdag
sday, smonth, syear = 5, 5, 1945
monthdiff = emonth - smonth
yeardiff = eyear - syear
daydiff = eday - sday
if daydiff < 0 then
leap = ((eyear % 4 == 0) and (eyear % 100 ~= 0)) or (eyear % 400 == 0)
mdays = { 31, (leap and 29 or 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
if emonth == 1 then
emonth = 12
else
emonth = emonth - 1
end
daydiff = daydiff + mdays[ emonth ]
monthdiff = monthdiff - 1
end
if monthdiff < 0 then
monthdiff = monthdiff + 12
yeardiff = yeardiff - 1
end
grp.checkupdate('62/7/51', yeardiff ..' jaar ' .. monthdiff ..' maanden ' .. daydiff ..' dagen ')