How can I create Date Object from Date and Time Strings in Lua NodeMCU? -


i playing around nodemcu on esp8266. have date string , time string web request this:

15.07.16 (german format dd.mm.yy)

19:50 (24 hours format)

these datetimes lay little bit in future. want number of minutes current time time strings above.

i guess have create time object strings , compare current time. how can lua?

unfortunately there no os library on nodemcu (or might have missed how enable it).

calculating difference manually huge pain avoid. know way compute available or external libraries?

thanks support!

there's pending pr rtctime except opposite, unix epoch utc calendar.

if convert strings unix epoch x do

-- delta in minutes local delta = (x - rtctime.get()) / 60 

you can either calculate x yourself, far trivial due leap years & seconds , other date/time oddities, or can send request http://www.convert-unix-time.com/api?date=15.07.2016%2019:50&timezone=vienna&format=german , extract timestamp it.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -