16.11.2016, 08:32
(16.11.2016, 07:35)admin Wrote: Or you can use a single regexp instead of many splits
Code:date = '2016-11-15T16:04:04.000+0000'
d = {}
d.year, d.month, d.day, d.hour, d.min, d.sec = date:match('(%d+)-(%d+)-(%d+)T(%d+):(%d+):(%d+)')
time = os.time(d)
Very short and elegant solution string:match is powerful tool