Date.lua

From Alpine Linux
Revision as of 14:40, 27 November 2007 by Ms13sp (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

date_to_seconds

INPUT:
This library function required the following inputs/parameters.

  • Table of dates
    • Example: t = { {year=2000,month=12,day=13}, {year=1987,month=4,day=30,hour=10}, {year=2020,month=1,day=10} }

OUTPUT:
This library function deliverers the following output/parameters.

  • Sorted table of dates in seconds since 1970
    • t = { 546775200, 976708800, 1578657600 }

CODING EXAMPLE:

-- Include/Call for this library
require("date")
temp = date.date_to_seconds(t) --see table t above
for a,b in ipairs(temp) do print(b) end
--546775200 
--976708800
--1578657600