[GitHub] utzig commented on a change in pull request #928: datetime: use timezone for clocktime_to_timeval
utzig commented on a change in pull request #928: datetime: use timezone for clocktime_to_timeval URL: https://github.com/apache/mynewt-core/pull/928#discussion_r176161809 ## File path: time/datetime/src/datetime.c ## @@ -140,6 +140,10 @@ clocktime_to_timeval(const struct clocktime *ct, struct os_timeval *tv) ct->sec; tv->tv_usec = ct->usec; +/* Convert localtime to utctime */ +tv->tv_sec += tz->tz_minuteswest * 60; Review comment: Should allow for passing no `tz` (aka `NULL`). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] utzig commented on a change in pull request #928: datetime: use timezone for clocktime_to_timeval
utzig commented on a change in pull request #928: datetime: use timezone for clocktime_to_timeval URL: https://github.com/apache/mynewt-core/pull/928#discussion_r176161653 ## File path: time/datetime/include/datetime/datetime.h ## @@ -68,7 +68,7 @@ int datetime_parse(const char *input, struct os_timeval *utctime, * * Returns 0 on success and OS_EINVAL on invalid input data */ -int clocktime_to_timeval(const struct clocktime *ct, struct os_timeval *tv); +int clocktime_to_timeval(const struct clocktime *ct, const struct os_timezone *tz, struct os_timeval *tv); Review comment: I'm not a big fan of changing APIs, but since this was only recently exported I think this is not a problem. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services