Date.lua

From Alpine Linux

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
    • temp = { 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

seconds_to_date

date_diff

num_month_name

num_month_name_abr

name_month_num

abr_month_num

num_dow_name

num_dow_abr

name_dow_num

abr_dow_num