lib/timeutils/timeutils: timeutils_mktime may accept negative time values.
And will normalize them.
This commit is contained in:
parent
d8cc51ea2b
commit
993cc3611a
@ -158,8 +158,8 @@ mp_uint_t timeutils_seconds_since_2000(mp_uint_t year, mp_uint_t month,
|
||||
+ (year - 2000) * 31536000;
|
||||
}
|
||||
|
||||
mp_uint_t timeutils_mktime(mp_uint_t year, mp_uint_t month, mp_uint_t mday,
|
||||
mp_uint_t hours, mp_uint_t minutes, mp_uint_t seconds) {
|
||||
mp_uint_t timeutils_mktime(mp_uint_t year, mp_int_t month, mp_int_t mday,
|
||||
mp_int_t hours, mp_int_t minutes, mp_int_t seconds) {
|
||||
|
||||
// Normalize the tuple. This allows things like:
|
||||
//
|
||||
|
@ -49,7 +49,7 @@ void timeutils_seconds_since_2000_to_struct_time(mp_uint_t t,
|
||||
mp_uint_t timeutils_seconds_since_2000(mp_uint_t year, mp_uint_t month,
|
||||
mp_uint_t date, mp_uint_t hour, mp_uint_t minute, mp_uint_t second);
|
||||
|
||||
mp_uint_t timeutils_mktime(mp_uint_t year, mp_uint_t month, mp_uint_t mday,
|
||||
mp_uint_t hours, mp_uint_t minutes, mp_uint_t seconds);
|
||||
mp_uint_t timeutils_mktime(mp_uint_t year, mp_int_t month, mp_int_t mday,
|
||||
mp_int_t hours, mp_int_t minutes, mp_int_t seconds);
|
||||
|
||||
#endif // __MICROPY_INCLUDED_LIB_TIMEUTILS_H__
|
||||
|
Loading…
x
Reference in New Issue
Block a user