How can I get a Time object with the date of tomorrow?
Something like
local tomorrow = domoticz.time.addDay(1)
Thanks for your help.
Date of tomorrow [Solved]
Moderator: leecollings
Re: Date of tomorrow
I don't think you can.
In the dzVents documentation is stated:
Note: it is currently not possible to change a time object instance.
Maybe you can do something like this in native LUA (untested):
In the dzVents documentation is stated:
Note: it is currently not possible to change a time object instance.
Maybe you can do something like this in native LUA (untested):
Code: Select all
t = os.date("*t")
t.day = t.day + 1
tomorrow = os.time(t)
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Date of tomorrow
in dzVents you would do
Code: Select all
local day = 24*3600
local Time = require('Time')
local newTime = Time( os.date("%Y-%m-%d %H:%M:%S", os.time() + day ))
dz.log(newTime.rawDate .. ' ' .. newTime.rawTime,dz.LOG_FORCE)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 327
- Joined: Thursday 15 November 2018 21:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Netherlands
- Contact:
Re: Date of tomorrow
Thx waaren, I will try this
-
- Posts: 327
- Joined: Thursday 15 November 2018 21:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Netherlands
- Contact:
Re: Date of tomorrow [Solved]
Finally had the time to test this and it works great. Thanks Waaren
Who is online
Users browsing this forum: No registered users and 0 guests