Page 1 of 1

Marty's back from the future!

Posted: Tue Dec 05, 2017 6:22 pm
by fma
Hi!

I'm finally making tests with my Wipy 1.0 (kickstarter) boards...

My first project is to replace an Arduino I used to make a fancy Stargate clock, using RGB bus leds. The nice thing is I will be able to automatically sync with a ntp serveur to set the current date/time.

I used a recipe for ntp, which works fine, but I found a strange issue: when converting time as seconds to tuple, using time.localtime(), I get a 30 years date in the future!!! No kidding!

On my desktop machine:

Code: Select all

>>> time.localtime(1512497491)
time.struct_time(tm_year=2017, tm_mon=12, tm_mday=5, tm_hour=19, tm_min=11, tm_sec=31, tm_wday=1, tm_yday=339, tm_isdst=0)
Then, on the Wipy:

Code: Select all

>>> time.localtime(1512497491)
(2047, 12, 5, 18, 11, 31, 3, 339)
Doc: No! It can't be. I just sent you back to the future.
Marty: I know, you did send me back to the future, but I'm back, I'm back from the future.

Re: Marty's back from the future!

Posted: Tue Dec 05, 2017 11:45 pm
by SpotlightKid
MicroPython on bare-metal uses another epoch than Unix:

http://docs.micropython.org/en/latest/w ... utime.html

Re: Marty's back from the future!

Posted: Wed Dec 06, 2017 5:52 am
by fma
Thanks!

Re: Marty's back from the future!

Posted: Sun Dec 10, 2017 8:06 pm
by mcauser
Doc: Great Scott!
Marty: This is heavy!