22.08.2020, 10:51
(21.08.2020, 07:21)Erwin van der Zwart Wrote: Hi,Hi Erwin,
You made it way to complicated (: Try this:
To have a table like in your initial question try this:Code:time = os.time()
data = {}
for i = 1, 365 do
datetimetable = os.date('*t', time)
data[ i ] = { day_num = datetimetable.wday, week_day = os.date('%A', time), day_in_month = datetimetable.day, month_date = datetimetable.month}
time = time - 86400 -- substract 1 day
end
log(data)
BR,Code:time = os.time()
data = {}
for i = 1, 14 do
data['day ' .. i] = { date = os.date('%x', time), day = os.date('%A', time)}
time = time - 86400 -- substract 1 day
end
log(data)
Erwin
Yes i did make it very complicated..., your way is much better
Many Thanks