I have a datestring like this: "12/12/2016 7:23:17 PM"
How can I convert it to something useful without rewriting a bunch of date logic?
All I actually care about is getting the rough number of seconds of time from that date until now.
I guess I can just hack it, ignoring leap years, etc, but I was hoping there would be something better.
function date2ostime(dateStr) --12/12/2016 7:23:17 PM local res = {} for mm in dateStr:gmatch("(%d+)") do table.insert(res,mm) print(mm) end return os.time{year=res[3], month=res[1], day=res[2], hour=res[4], min=res[5], sec=res[6]} end