42 Commits

Author SHA1 Message Date
Joshua Jackson d784766640 iOS Simulator support 2020-05-24 21:31:18 -04:00
Howard Hinnant 9a0ee25428 Do a runtime test for realpath vs readlink
* Ubuntu needs to use readlink under current_zone
  and most everyone else needs realpath.  Attempting
  to make everyone happy with this commit.
2020-01-25 10:05:26 -05:00
Ten10 940f4a5ceb Support Curl Error Buffer
Allow user to get error message when download fails
2019-11-29 19:38:40 -05:00
Howard Hinnant 3e376be2e9 Rename link to time_zone_link
* At the request of LEWG
2019-11-08 19:36:09 +00:00
Howard Hinnant 224c71a899 Rename leap to leap_second and leaps to leap_seconds
* At the request of LEWG
2019-11-08 19:24:03 +00:00
Mike Ellery 48f1455cd2 CMake refactor for easier subdirectory inclusion 2019-10-18 14:59:37 -04:00
Howard Hinnant 3f0f9b3cbe Search for '/' after "zoneinfo" in current_zone() 2019-10-14 15:54:32 -04:00
Howard Hinnant 4481c75192 Improve current_zone().
Fixes #454
2019-09-23 22:09:13 -04:00
James Beach 46ccd69c9c Resolve GCC 9.1.0 unused-function warning 2019-07-21 23:18:54 -04:00
Matt Kline 7ef1a55143 tz.cpp: Cast conversions to/from size_t
These cause warnings with -Wsign-conversion.
2019-07-21 20:46:01 -04:00
muriukip ed0368fc75 The URL for windowsZones.xml changed to (#447)
https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml
2019-05-15 12:08:24 -04:00
Elvis Oric 429d9ba739 Add User-Agent curl option in download_to_string function. [#438] 2019-04-19 09:07:03 -04:00
Daniela Engert 10ab6ae9e5 Fix warnings from Clang (#421)
Clang 9 (in Visual Studio) complains about a mixed signed-unsigned comparison and an unused function.
Replace the naked `int` constant -1 by `std::size_t(-1)` with the same codegen as before (no curlies to avoid narrowing).
Guard the definition of `get_download_folder()` by the same condition as its call-site.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2019-03-19 20:25:59 -04:00
Howard Hinnant 9cb0013aef Update time_of_day to be more consistent ...
the needs of formatting.
2019-02-02 14:06:12 -05:00
Howard Hinnant f1326968af Make compatible with const-only string.data() spec 2019-01-31 19:23:17 -05:00
Daniela Engert 61c3d35634 Fix problem with wchar_t* to std::string conversion. (#419)
VS2019 correctly points out that a conversion from a wide NTCS to std::string requires narrowing. This may result in an undesired string value. Implement the string conversion properly.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2019-01-27 17:08:01 -05:00
apretori-tic 2cb4c34009 Ignore tzdata.zi and leapseconds tzdb files on Linux when loading time zones (#411) 2018-12-18 12:15:00 -05:00
Howard Hinnant 0e85704e47 Don't write to ~/Downloads if not installing there 2018-12-14 20:12:55 -05:00
Howard Hinnant be2ec2310b Emphasize Sunday over sun in the implementation
*  Keep the three letter lower case spellings for backwards
   compatibility purposes.
2018-06-03 13:55:00 -04:00
Eugene Golushkov 6c4d333026 fixed build in WinRT mode, where some API are not available 2018-06-02 16:14:18 -04:00
Howard Hinnant 973bd393bc Respect and minimize tie/flush in from/to_stream
* Save/restore tie, setting it to nullptr during the operation
* On construction tie_->flush()
* For ostreams only, flush if unitbuf
2018-04-18 21:47:15 -04:00
Marsh Ray 38c5ca38bb Typo fixes in comment text 2018-03-04 18:26:07 -05:00
Howard Hinnant 040eed838b Augment path to ios.h 2018-01-26 19:53:51 -05:00
Benno Evers 2acf403bcd Dont include ios.h unconditionally.
The include in tz.cpp was changed to only include the ios.h header
when compiling on apple platforms, as the documentation states that
only the four files date.h, tz.h, tz_private.h, and tz.cpp should be
required to use the time zone library.

Additionally, the ios.mm file was moved to src/ since it contains
C++ source code.
2018-01-24 20:24:10 -05:00
Xuesong Hu 6941691de4 implement current_zone() for iOS using native API from iOSUtils 2018-01-12 14:59:01 -05:00
Howard Hinnant 55289f0d73 Make tz_dir a function-local static
* This solves initialization order issues detailed
  in https://github.com/HowardHinnant/date/issues/275
2018-01-05 19:26:44 -05:00
Joshua Jackson 0af7654764 Fix iOS build 2017-12-11 05:45:27 -06:00
Howard Hinnant 1eeb4cd652 Prepare for the new definition of IST
* Irish Standard Time has a -1h save in the winter instead
  of a +1h save in the summer.
2017-12-08 13:08:40 -05:00
Peter Karlovsek 5653e9e3a9 Fixes CURLE_SSL_CACERT (60) when downloading tzdata2017c.tar.gz 2017-12-01 12:14:41 -05:00
Howard Hinnant c2e139ef53 Replace realpath with readlink
* Appears to be more modern and Debian Stretch requires it.
2017-11-30 17:17:28 -05:00
Howard Hinnant 87ed7f83cf Correct IANA data download URL 2017-11-27 12:44:57 -05:00
Darrell Wright 4614ebda4a Update to accomidate change of iana url #241 2017-11-23 20:25:00 -05:00
Tullio Menga f4b12ab023 Adjust HAS_CHRONO_ROUNDING macro for MSVC with v140_clang_c2 and LLVM-vs2014 2017-11-20 11:45:04 -05:00
Michael Maroszek 16439a8ce2 enhance tz_dir detection for buildroot with uclibc systems
* use /etc/TZ for timezone detection on buildroot with uclibc systems
2017-11-19 18:42:13 -05:00
Aaron Bishop c9ef0a8f05 express reverse_bytes in an easy to optimize way
optimizes to single bswap instruction on gcc and clang
2017-11-19 17:52:17 -05:00
Tullio Menga ec514101a6 minor patches to build on Windows with MSVC v140_clang_c2 and LLVM-vs2014 2017-11-15 07:20:07 -05:00
Howard Hinnant 2e213abb76 Silence clang static analyzer warnings 2017-10-03 12:45:09 -04:00
Howard Hinnant 3acb299f3f Rename TZ_DB to tzdb
* Bring into alignment with proposal
* TZ_DB alias left behind for backwards compatibility
2017-09-30 14:48:25 -04:00
Howard Hinnant 22a229af91 On macOS tz_dir is now discoverable at run time
* Apple changed the location of their IANA database in High Sierra,
  breaking current_zone().  Now on Apple the location of the IANA
  database is searched for at run time.
2017-09-26 09:47:24 -04:00
tagunil bff551b2a5 Convert Windows header file names to lower case 2017-09-23 19:55:56 -04:00
Howard Hinnant 9f6c8d8c10 Update include paths for new directory structure 2017-09-22 20:10:58 -04:00
Markus Werle 3c3ba68906 Proposal for an alternative directory structure 2017-09-22 20:03:16 -04:00