Page 1 of 1

problem with Time object

Posted: Tuesday 12 September 2017 13:37
by bigpea
Hi all,
I'm trying to create a Time object in order to know the difference between a fixed time and the actual time.
I'm following this guide: https://www.domoticz.com/wiki/DzVents:_ ... ime_object but I have a problem.

My code:

Code: Select all

local Time = require('Time')
local t = Time('2016-12-12 07:35:00')
print('t.minutesAgo(): '..t.minutesAgo()) -- difference from 'now' in minutes
The error in console:

Code: Select all

attempt to call field 'minutesAgo' (a number value)
Could you help me please?

Thanks.

Re: problem with Time object

Posted: Tuesday 12 September 2017 13:44
by bigpea
Sorry, the problem is in the string "t.minutesAgo()"
We have to use this function without the "()", so "t.minutesAgo"
I will ask to correct the guide. :)

Re: problem with Time object

Posted: Tuesday 12 September 2017 21:26
by dannybloe
Good catch! I fixed it in the documentation.