6027bcb1e2
POSIX and glibc do not guarantee that tzset() is called by localtime_r(). tzset sets the timezone name, UTC offset and whether or not it is daylight savings time. Android <= 7.1.1 did *not* call tzset() in localtime_r(), which means that users will see their timezone as "GMT". macOS/iOS seem to guarantee that tzset() is called by localtime_r() but the wording is vague: localtime_r() and gmtime_r() functions provide the same functionality as localtime() and gmtime()... N.B.: localtime() is guaranteed to call tzset(). tzset() must be called before each localtime_r() to catch the case where the user changes the timezone while the application is running. Bug:https://github.com/dart-lang/sdk/issues/53276 Change-Id: I0503a0a109aa6c281c9a3aefe8ba0b54841a42a7 Tested: manually tested on Android 7.1.1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336240 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Brian Quinlan <bquinlan@google.com>