Marty's back from the future!

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
Post Reply
fma
Posts: 164
Joined: Wed Jan 01, 2014 5:38 pm
Location: France

Marty's back from the future!

Post by fma » Tue Dec 05, 2017 6:22 pm

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.
Frédéric

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Marty's back from the future!

Post by SpotlightKid » Tue Dec 05, 2017 11:45 pm

MicroPython on bare-metal uses another epoch than Unix:

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

fma
Posts: 164
Joined: Wed Jan 01, 2014 5:38 pm
Location: France

Re: Marty's back from the future!

Post by fma » Wed Dec 06, 2017 5:52 am

Thanks!
Frédéric

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Marty's back from the future!

Post by mcauser » Sun Dec 10, 2017 8:06 pm

Doc: Great Scott!
Marty: This is heavy!

Post Reply