Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
5e38b48d
Commit
5e38b48d
authored
May 19, 2015
by
Daniel Campora
Browse files
cc3200: Fix time.localtime() so that it returns the correct fields.
parent
56053c37
Changes
1
Hide whitespace changes
Inline
Side-by-side
cc3200/mods/modutime.c
View file @
5e38b48d
...
...
@@ -73,11 +73,11 @@ STATIC mp_obj_t time_localtime(mp_uint_t n_args, const mp_obj_t *args) {
mp_obj_new_int
(
tm
.
tm_year
),
mp_obj_new_int
(
tm
.
tm_mon
),
mp_obj_new_int
(
tm
.
tm_mday
),
mp_obj_new_int
(
tm
.
tm_wday
),
mp_obj_new_int
(
tm
.
tm_hour
),
mp_obj_new_int
(
tm
.
tm_min
),
mp_obj_new_int
(
tm
.
tm_sec
),
mp_obj_new_int
(
mseconds
)
mp_obj_new_int
(
tm
.
tm_wday
),
mp_obj_new_int
(
tm
.
tm_yday
)
};
return
mp_obj_new_tuple
(
8
,
tuple
);
}
else
{
...
...
@@ -105,7 +105,6 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(time_localtime_obj, 0, 1, time_localtime);
/// which expresses a time as per localtime. It returns an integer which is
/// the number of seconds since Jan 1, 2000.
STATIC
mp_obj_t
time_mktime
(
mp_obj_t
tuple
)
{
mp_uint_t
len
;
mp_obj_t
*
elem
;
...
...
@@ -119,7 +118,6 @@ STATIC mp_obj_t time_mktime(mp_obj_t tuple) {
return
mp_obj_new_int_from_uint
(
timeutils_mktime
(
mp_obj_get_int
(
elem
[
0
]),
mp_obj_get_int
(
elem
[
1
]),
mp_obj_get_int
(
elem
[
2
]),
mp_obj_get_int
(
elem
[
3
]),
mp_obj_get_int
(
elem
[
4
]),
mp_obj_get_int
(
elem
[
5
])));
}
MP_DEFINE_CONST_FUN_OBJ_1
(
time_mktime_obj
,
time_mktime
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment