21.08.2020, 07:21
(This post was last modified: 21.08.2020, 10:04 by Erwin van der Zwart.)
Hi,
You made it way to complicated (: Try this:
To have a table like in your initial question try this:
BR,
Erwin
You made it way to complicated (: 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)
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