Commit 4c74f061 authored by fpletz's avatar fpletz Committed by schneider
Browse files

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

Needed due to changes from 8c59935e.

cc !146
parent e0824843
......@@ -25,16 +25,18 @@ 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)
Sets the time to ``secs`` seconds since 1970-01-01 00:00 UTC.
This corresponds a regular Unix timestamp which can be obtained
This corresponds to a regular Unix timestamp which can be obtained
by running ``date +%s`` in a command line or ``int(time.time())``
in Python.
......
......@@ -19,8 +19,8 @@
static mp_obj_t time_set_time(mp_obj_t secs)
{
uint64_t timestamp =
mp_obj_get_int(secs) * 1000ULL + EPOCH_OFFSET * 1000ULL;
uint64_t timestamp = mp_obj_get_int(secs) * 1000ULL +
EPOCH_OFFSET * 1000ULL + TZONE_OFFSET;
epic_rtc_set_milliseconds(timestamp);
return mp_const_none;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment