This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How to integrate a geolocalisation and LM?
#13
(16.11.2016, 07:35)admin Wrote: Or you can use a single regexp instead of many splits Smile

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 solutionWink string:match is powerful toolWink
Reply


Messages In This Thread
RE: How to integrate a geolocalisation and LM? - by buuuudzik - 16.11.2016, 08:32

Forum Jump: