summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDaniel Campora <daniel@wipy.io>2015-05-19 11:36:16 +0200
committerDaniel Campora <daniel@wipy.io>2015-05-20 11:44:22 +0200
commit5e38b48dd621ef1c1cefce87d4126b31a85cbcfc (patch)
tree82c859e64ad121427df9fdf86b00cf8d3d2ab273
parent56053c37cf5ffc6cb81e67817d8e77c490ca7e38 (diff)
downloadmicropython-5e38b48dd621ef1c1cefce87d4126b31a85cbcfc.tar.gz
micropython-5e38b48dd621ef1c1cefce87d4126b31a85cbcfc.zip
cc3200: Fix time.localtime() so that it returns the correct fields.
-rw-r--r--cc3200/mods/modutime.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/cc3200/mods/modutime.c b/cc3200/mods/modutime.c
index dc4fcf152c..210c8ce5ae 100644
--- a/cc3200/mods/modutime.c
+++ b/cc3200/mods/modutime.c
@@ -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);