Skip to content
Snippets Groups Projects
Verified Commit 54177a70 authored by fpletz's avatar fpletz :snowflake:
Browse files

fix(utime.c): set_time should operate in local tz

Needed due to changes from c7f59d3e.

cc !146
parent 8c59935e
No related branches found
No related tags found
No related merge requests found
Pipeline #2614 failed
......@@ -25,11 +25,13 @@ alarm.
.. py:function:: time()
Return the current timestamp in seconds since 2000-01-01 00:00.
Return the current timestamp in seconds since 2000-01-01 00:00 in
the local timezone.
.. py:function:: set_time(secs)
Sets the time to ``secs`` seconds since 2000-01-01 00:00.
Sets the time to ``secs`` seconds since 2000-01-01 00:00 in the local
timezone.
.. py:function:: set_unix_time(secs)
......
......@@ -20,7 +20,7 @@
static mp_obj_t time_set_time(mp_obj_t secs)
{
uint64_t timestamp =
mp_obj_get_int(secs) * 1000ULL + EPOCH_OFFSET * 1000ULL;
mp_obj_get_int(secs) * 1000ULL + EPOCH_OFFSET * 1000ULL + TZONE_OFFSET;
epic_rtc_set_milliseconds(timestamp);
return mp_const_none;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment