(12.02.2021, 12:14)admin Wrote: Date/time is stored as UNIX timestamp. Check for month number wrap is not needed, it is handled by the os.time() automatically.
Keep in mind that alerts are deleted automatically, make sure that you've set the limit correctly in Utilities > General configuration.Code:date = os.date('*t')
date.day, date.hour, date.min, date.sec = 1, 0, 0, 0
ts_end = os.time(date)
date.month = date.month - 1
ts_start = os.time(date)
alerts_table = db:getall('SELECT * FROM alerts where alerttime BETWEEN ? AND ? ORDER BY id DESC', ts_start, ts_end)
i'm trying the code but surely i'm wrong something, the code gives me the following values for the range
From 01/01/21 to - 02/01/21
I think there is a problem with the date format , swap day and month , i have a alarm inside but return nothing to export in csv
Thank's