We have moved at community.getvera.com

Author Topic: Luup for time and unixtime  (Read 1344 times)

Offline nullx8

  • Hero Member
  • *****
  • Posts: 870
  • Karma: +9/-3
  • Trouble !
Luup for time and unixtime
« on: November 21, 2013, 10:25:56 am »
Does anyone know how this can be done

If time between 22:00 and 23:00 then

And does may someone know how i get the unixtime via luup ?
1 VeraLite, 2 RaspberryPI, Harmony Remote, openLuup, 85 Devices, 34Nodes, 63 Triggers, 49 Scenes

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Luup for time and unixtime
« Reply #1 on: November 21, 2013, 10:43:33 am »
If you are going to program in LUA you need to RTFM

http://www.lua.org/manual/5.1/manual.html

Check out os.date and os.time

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Luup for time and unixtime
« Reply #2 on: November 21, 2013, 10:46:09 am »
Quote
And does may someone know how i get the unixtime via luup ?
Code: [Select]
local curtime = os.time()
Quote
Does anyone know how this can be done

If time between 22:00 and 23:00 then
Code: [Select]
local dtT = os.date("*t")
if (dtT.hour >= 22) and (dtT.hour < 23) then

And as @RichardTSchaefer advised...