Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 780 Bytes

getdatetime.md

File metadata and controls

34 lines (27 loc) · 780 Bytes

getDateTime()

#####Overview Returns the date and time from the transmitter realtime clock

  • Parameters: none
  • Returns: a Lua table with the following named elements
    • year
    • mon
    • day
    • hour
    • min
    • sec
  • Status: current Introduced in 2.0.0

#####Example telemetry script

local function run(e)
  local datenow = getDateTime()
  lcd.clear()
  lcd.drawText(1,1,"getDateTime() example",0)
  lcd.drawText(1,11,"year, mon, day: ", 0)
  lcd.drawText(lcd.getLastPos()+2,11,datenow.year..", "..datenow.mon..", "..datenow.day,0)
  lcd.drawText(1,21,"hour, min, sec: ", 0)
  lcd.drawText(lcd.getLastPos()+2,21,datenow.hour..", "..datenow.min..", "..datenow.sec,0)
end

return{run=run}

#####Example output getDateTime() example output