Skip to content

Commit

Permalink
Parse and emit years from 1900 to 9999, and remove environment variab…
Browse files Browse the repository at this point in the history
…le dependence on Android (#1117)

Update date formatting and parsing to accept all years between 1900 and 9999.

This unblocks the Azure Storage SDK which uses 9999-12-31 as a sentinel value for "no expiration time" which was broken by the locale insensitive date formatting's dependence on _mkgmtime, with its 1970-3000 range. By morally reimplementing _mkgmtime, this change also lets us remove the Android workaround of changing the TZ environment variable.

Release\tests\functional\utils\datetime.cpp

Turn on tests for values that would need 64 bits represented as a time_t, even for 32 bit time_t platforms.
Add year 1900 and 9999 test cases, and remove year 3000+ and 1969- negative tests.
Release\tests\functional\http*

Drive by fix for new VS2019 warnings about narrowing.
Release\src\utilities\asyncrt_utils.cpp

Remove dependence on _mkgmtime and gmtime_r/gmtime_s by implementing replacements loosely inspired by both the C runtime's date operations and .NET's handling of the Gregorian calendar's 400 year cycle.
  • Loading branch information
BillyONeal authored Apr 19, 2019
1 parent c9707ef commit e2818b8
Show file tree
Hide file tree
Showing 4 changed files with 325 additions and 242 deletions.
Loading

0 comments on commit e2818b8

Please sign in to comment.