Hi,
This function should work to covert to Unix timestamp from MySQL. I’ll add it in the next release. But you can add it locally to your server-side API for now.
Code
local function tsToUnix(mysql\_ts) local pattern = "(%d+)%-(%d+)%-(%d+) (%d+):(%d+):(%d+)" local xyear, xmonth, xday, xhour, xmin, xsec = mysql\_ts:match(pattern) local unixTs = os.time({year=xyear, month=xmonth, day=xday, hour=xhour, min=xmin, sec=xsec}) return unixTs end
Example
local unix\_ts = tsToUnix( "2018-04-23 20:39:39" ) print( unix\_ts ) --\> 1524533979
Hope that helps.
-dev