Bug AtomS3 with UIFlow2 on library time
-
on Alpha 9, the software Time library still return false values:
"get UTC time" return a tuple where:
- Year is with difference of +30 to reality
- Day is with difference of -1 to reality
"get system uptime in seconds" is definitely false with a very high value
it come probably from a confusion between unix time year 1970 and unix time year 2000
thanks
-
@flex on Alpha 10 the problem remains
-
@flex said in Bug AtomS3 with UIFlow2 on library time:
on Alpha 10 the problem remains
on Alpha 11 the problem remains
-
Hi, did you check this time docs of micropython port?
-
@imaliubo
yes I tried,
it seems that UIFlow (based on 1.19.1) doesn't take epoch into account, which is year 2000 in MP 1.19.1 or 1.20.
Apart that there is confusion created on gmtime() and localtime() in UIFlow apis.
Also to mention that in MP 1.20, the returned values from gmtime() and localtime() are not all time reliable (sometimes the ntpserver requested in MP localtime() return what in fact is gmtime()...)
-
Hi dev Team,
I made small test on Alpha17:
-
now "get UTC time" works correctly :)
-
There is problem when using "Set timezone GMTx":
using "Set timezone GMT+2" and then "get local time", it should return UTC+2/GMT+2 but it return UTC-2/GMT-2 -
There is still problem with "get system uptime in seconds" which is not adjusted to epoch 2000 and returns a very big value
Thanks
-
-
There is problem when using "Set timezone GMTx":
using "Set timezone GMT+2" and then "get local time", it should
return UTC+2/GMT+2 but it return UTC-2/GMT-2honestly, I was confused at first, but i saw this link, it explain why the time zone is reversed:https://stackoverflow.com/questions/53076575/time-zones-etc-gmt-why-it-is-other-way-round
There is still problem with "get system uptime in seconds" which is not adjusted to epoch 2000 and returns a very big value
ok, thanks for report, will check this and fix.
-
Sorry, last update(aplha-17) we change the epoch time from "2000-01-01" ot "1970-01-01".So "get system uptime in seconds" block return is tiem stamp from 1970-01-01. And use "1970-01-01" as epoch is more compatible.
-
I think that Micropython use epoch 2000 by default
-
@IAMLIUBO I'm getting an issue with time with 1.11.9 both the core and core 2 are showing an error with time "Module Time has no attribute"
-
@iamliubo
Hi
System uptime in seconds should return 0 when the system (m5stack ….S3) starts, nobostand epoch 1970 or 2000… -
@flex yes, we change to 1970
-
@ajb2k3 can you show me the code?
-
@flex said in Bug AtomS3 with UIFlow2 on library time:
@iamliubo
Hi
System uptime in seconds should return 0 when the system (m5stack ….S3) starts, nobostand epoch 1970 or 2000…When boot up, if device connect to wifi will auto sync the time from ntp server, and time.time() this function will overwritten by new time.
-
@iamliubo said in Bug AtomS3 with UIFlow2 on library time:
@ajb2k3 can you show me the code?
We solved it over Twitter
-