Commit Graph
100 Commits
Author SHA1 Message Date
Howard Hinnant bf79dd5a81 Update README.md 2021-01-11 20:05:18 -05:00
Howard Hinnant 26fc2bd372 Fix read_long_double with respect to decimal_point:
*  Respect locale settings when ONLY_C_LOCALE=0
*  Do not respect locale settings when ONLY_C_LOCALE=1
Fixes #637
2021-01-05 21:14:41 -05:00
Howard Hinnant 97246a638a Silence lossy conversion warning
Fixes #620
2020-11-10 08:41:30 -05:00
Howard Hinnant 215cacff56 Change all uses of round to detail::round_i
Fixes #613

detail::round_i is the same as round when the To::rep
is integral, and is just an implicit conversion when
To::rep is floating point.
2020-10-25 20:16:07 -04:00
Howard Hinnant 7848566815 Fix a parse error for Visual Studio 2020-10-02 12:53:16 -04:00
Howard Hinnant 393b52f21b Update README.md 2020-09-19 10:15:51 -04:00
Howard Hinnant 0b72599bd4 For USE_OS_TZDB, look for version number in the files
version and +VERSION
2020-09-11 16:00:18 -04:00
Howard Hinnant ba99134b8a For USE_OS_TZDB, look for leap seconds in the files
leapseconds and leap-seconds.list
2020-09-11 15:53:07 -04:00
Howard Hinnant 5e18488899 Fix subtle bug in fractional_width 2020-09-05 16:34:04 -04:00
Howard Hinnant 1ec2ea0295 Add test/tz_test/tzdb_list.pass.cpp 2020-08-17 21:34:20 -04:00
Howard Hinnant 658a3b9495 Fix crasher for early local times and USE_OS_TZDB=1 2020-08-17 21:34:20 -04:00
Howard Hinnant 569b2d6785 Improve error message while parsing posix timezone string 2020-08-02 10:56:37 -04:00
Howard Hinnant abe3ada04f Update README.md 2020-07-28 17:00:00 -04:00
Howard Hinnant 6952fb50a6 Correct the value for not_a_year 2020-07-08 14:20:31 -04:00
Howard Hinnant fe2f9c7eac Change constexpr to CONSTDATA 2020-07-07 15:01:45 -04:00
Howard Hinnant a55f1a103b Update README.md 2020-06-15 15:18:20 -04:00
Howard Hinnant d544e5af25 Throw exception if zoned_time is constructed with nullptr 2020-06-14 19:30:23 -04:00
Howard Hinnant cac99da8dc For traits in constexpr context use ::value
* Fixes #542
2020-06-02 21:08:57 -04:00
Howard Hinnant a088baf9a5 Update README.md 2020-05-26 11:47:28 -04:00
Howard Hinnant 9343e31599 Give Posix::time_zone equality comparison 2020-05-24 21:31:18 -04:00
Howard Hinnant f43c39fcf1 Add member function name() const to Posix::time_zone
* Returns the minimal string that uniquely identifies this
  time_zone.  That is, it takes advantage of all defaults.
2020-05-06 22:12:15 -04:00
Howard Hinnant e12095f26f Revert change for floating point reps in decimal_format_seconds 2020-04-18 09:24:53 -04:00
Howard Hinnant 7d811743e0 Fix parse of second offset in posix time zone 2020-04-18 09:24:22 -04:00
Howard Hinnant a2fdba1adc __GNUC_MINOR -> __GNUC_MINOR__
* Fixes #560
2020-03-30 12:50:37 -04:00
Howard Hinnant 4c1968b8f0 Fix constexpr overflow problems on gcc-7-9 2020-03-08 21:58:56 -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
Howard Hinnant a184309786 Fix unwanted localization of integral grouping
* Fixes #525
2020-01-01 11:12:14 -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
Howard Hinnant d399e10cba Bump zoned_time fixes for MSVC from 1900 to 1916 2019-10-22 13:28:48 -04:00
Howard Hinnant 96ffe23f72 Replace INTMAX_MAX with numeric_limits 2019-10-21 22:22:50 -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
Howard Hinnant a5c4b4ebf8 Protect is_am and make12 from ADL 2019-09-17 15:48:15 -04:00
Howard Hinnant 141ba85614 Fix space-matches 0 spaces at end of format string 2019-08-23 15:51:18 -04:00
Howard Hinnant a029f1105d Conditionally set _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING 2019-05-19 22:46:35 -04:00
Howard Hinnant 44215f6781 Eschew using directives in headers, even at function scope.
* There is still an impact on user code, though I'm not sure
  if by specification or compiler bug.
* Prefer using declarations instead.
2019-05-19 21:53:29 -04:00
Howard Hinnant 081e9af55b Migrate ptz.h from jan to January 2019-04-05 22:36:21 -04:00
Howard Hinnant 8a563041fa Adjust HAS_STRING_VIEW for VS
Fixes #330
2019-04-05 09:19:54 -04:00
Howard Hinnant 9dc96fd9b5 Silence warning
Fixes #337
2019-03-26 18:13:39 -04:00
Howard Hinnant 8b69087d35 Fix up constexpr of changed weekday_from_days 2019-03-21 12:23:38 -04:00
Howard Hinnant d5e96f0991 Suppress VS-15 warning about concerning conditional expression is constant
Thanks to https://github.com/ujos for the report.
2019-03-20 21:24:01 -04:00
Howard Hinnant cb7ca96f68 Protect weekday_from_days from signed overflow
Found by static analyzer.
This change makes weekday_from_days slightly more efficient.
2019-03-19 19:51:32 -04:00
Howard Hinnant b5d025ea2f Align time_of_day with hh_mm_ss
Per committee review
2019-03-19 19:50:30 -04:00
Howard Hinnant f782ae98f0 Fix type-o again 2019-02-20 15:27:44 -10:00
Howard Hinnant d6c5d02068 Fix type-o in get_leap_second_info_t 2019-02-20 15:25:50 -10:00
Howard Hinnant 16077472af Rename is_leap_second to get_leap_second_info 2019-02-20 15:19:54 -10:00
Howard Hinnant 5a62c405e0 Remove unneeded make_precision 2019-02-03 23:21:36 -05:00
Howard Hinnant 09a19a09f4 Further consolidate time_of_day logic
Adjust how it works for floating point durations.
2019-02-03 16:14:56 -05: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
Howard Hinnant 90d0440884 Introduce %q and %Q to_stream formatting flags
* These flags format a duration.
* %Q specifies the duration's numeric value.
* %q specifies the duration's SI abbreviation.
* Example: format("%Q %q", 45ms) == "45 ms"
2019-01-19 14:30:19 -05:00
Howard Hinnant 0e85704e47 Don't write to ~/Downloads if not installing there 2018-12-14 20:12:55 -05:00
Howard Hinnant 5f34c40523 More patches for VS-2017 compatiblity 2018-11-25 17:04:27 -05:00
Howard Hinnant 23b1f007fe Patch for VS-2017 compatiblity 2018-11-25 14:38:54 -05:00
Howard Hinnant a22125ca40 Remove constexpr from islamic::year::isleap for C++11 2018-11-20 09:00:12 -05:00
Howard Hinnant 8f91ef27ed Revert "Model the TAI-UTC difference between 1961 and 1972"
This reverts commit 1eed461d06.
2018-11-08 13:56:23 -08:00
Howard Hinnant 4b46deb4f9 Update README.md
Add  Valhalla (Open Source Routing Library/Service)
2018-11-01 15:19:35 -04:00
Howard Hinnant 54e8516af2 Update README with more accurate CMake info 2018-10-23 11:12:05 -04:00
Howard Hinnant 1eed461d06 Model the TAI-UTC difference between 1961 and 1972 2018-10-03 17:51:55 -04:00
Howard Hinnant 591f572b67 Allow %j to parse and format durations 2018-09-26 14:35:03 -07:00
Howard Hinnant 6b51ca8271 Add routinghub to README 2018-09-12 20:42:25 -04:00
Howard Hinnant 3e82a52d66 Add ViewTouch to list of project using this library 2018-08-27 19:33:16 -04:00
Howard Hinnant 6a4d93a0bd Silence more shadow warnings 2018-07-01 23:00:33 -04:00
Howard Hinnant 39d6730665 Silence shadow warnings 2018-07-01 22:37:25 -04:00
Howard Hinnant de6a03d337 Set _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING for VS 2018-06-27 09:21:19 -04:00
Howard Hinnant d50970b32a Some backwards compatibility fixes for VS-2013 2018-06-12 18:13:24 -04:00
Howard Hinnant 0197889505 Update to Sunday constants 2018-06-11 15:14:44 -04:00
Howard Hinnant d4fb7eb76d Put unspecified_month_disambiguator in namespace detail 2018-06-10 16:22:21 -04:00
Howard Hinnant f5f4d76936 Replace save_stream with save_ostream
* In islamic.h and julian.h
2018-06-10 15:44:43 -04:00
Howard Hinnant c7b69d949a Change the encoding for an invalid weekday from 7 to 8 2018-06-08 09:50:40 -04:00
Howard Hinnant 48baa942fc Use uncaught_exceptions in C++17 2018-06-06 13:52:23 -04:00
Howard Hinnant af415701ba Update wandbox link 2018-06-06 13:31:03 -04: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
Howard Hinnant 40b83654b6 [API BREAKING] Remove conversion from weekday to unsigned
* There has been a great deal of anguish over the encoding of
  weekdays:  whether [0, 6] maps to [Sunday, Saturday] or
  [1, 7] maps to [Monday, Sunday].  This commit attempts
  to address that issue, but will break a small amount of
  code at compile-time.  See below on how to fix that.

* The weekday constructor used to accept [0, 6] to represent
  [Sunday, Saturday].  It now accepts [0, 7] to represent
  [Sunday, Saturday] with both 0 and 7 mapping to Sunday.

* The conversion from weekday to unsigned has been removed.

* To convert a weekday to unsigned replace:

      auto u = unsigned{wd};

  with:

      auto u = (wd - Sunday).count();

  This maps [Sunday, Saturday] to [0, 6], which is the
  C/POSIX mapping.  If you prefer the ISO mapping
  ([Monday, Sunday] -> [1, 7]), then do:

      auto u = (wd - Monday).count() + 1;
2018-06-02 22:56:10 -04:00
Howard Hinnant 5d15157bbb Fix bug for parsing negative offsets of less than 1h 2018-05-05 12:01:56 -04:00
Howard Hinnant a91ceefb4e Allow %H %M and %S to deal with negative durations 2018-04-23 20:31:28 -04:00
Howard Hinnant 88c661e9f3 Fix zoned_time deduction guides 2018-04-23 20:30:58 -04:00
Howard Hinnant c665992a6e Allow heterogeneous zoned_time constructors
taking {string_view, zoned_time}
2018-04-21 17:45:52 -04:00
Howard Hinnant 9d0bcdb63f Fix deduction error in parse where only offset is requested 2018-04-18 21:56:11 -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
Howard Hinnant d53db7a1cb And yet more fixes to allow duplicate flags on parse 2018-04-15 15:32:24 -04:00
Howard Hinnant e5c69d84ab Fix constexpr issue for VS2015 2018-04-09 11:01:58 -04:00
Howard Hinnant b48a18a1d9 More fixes to allow duplicate parsing 2018-04-08 15:49:06 -04:00
Howard Hinnant cdb4b276d9 Allow duplicate parsing into the same fields
* as long as all duplicates produce consistent results.
2018-04-07 21:42:00 -04:00
Howard Hinnant 1d9e49ea21 to_stream sets failbit if unable to format
*  If a formatting flag requests data that is not available in
   the Streamable object, or if the Streamable object answers !ok(),
   failbit is set.
2018-04-06 11:19:44 -04:00
Howard Hinnant 0125d330ab Correct to_stream/from_stream handling of stream data
* to_stream and from_stream now reset the stream formatting state to
  default settings on entry, and restore the stream state on exit.

* to_stream and from_stream now correctly handle mis-modified flags.

* Fix %h to be equivalent to %b instead of %B.

* This addresses issues 319, 320 and 321.
2018-03-31 13:06:57 -04:00
Howard Hinnant 700489e475 Introduced full weekday and month names
* The standardized version of this library has std::chrono::January
  and std::chrono::Sunday in place of std::chrono_literals::jan and
  std::chrono_literals::sun.  Compatible names added to namespace
  date to ease transition from this lib to std::chrono.  The old
  names are retained for backwards compatibility.
2018-03-18 18:27:04 -04:00
Howard Hinnant 20f0595b32 Update standardization progress 2018-03-17 10:57:45 -04:00
Howard Hinnant 674a9e6953 Update README.md 2018-03-16 15:42:13 -04:00
Howard Hinnant bc8cf368e5 Update readme link to d0355r6 2018-03-14 22:50:18 -04:00
Howard Hinnant 1e8ab50f82 Test modifications for standardization 2018-03-14 22:49:04 -04:00
Howard Hinnant 0bde4ba8c8 Make the parsing of minutes optional under the flag %z 2018-03-03 11:57:03 -05:00
Howard Hinnant 43d8a4eab0 Range check minutes under parse 2018-03-02 09:03:41 -05:00
Howard Hinnant 5524dd1ae8 Update README.md 2018-02-15 18:49:37 -05:00
Howard Hinnant 4ada98d247 Enable testing in CMakeLists.txt
* Per instructions by @SlavSlavov in https://github.com/HowardHinnant/date/pull/278
2018-01-29 08:39:58 -05:00
Howard Hinnant 040eed838b Augment path to ios.h 2018-01-26 19:53:51 -05:00
Howard Hinnant 3b8372f4fa Avoid use of undeclared to_utc_time.
* Fixes https://github.com/HowardHinnant/date/issues/289
2018-01-18 15:55:58 -05:00
Howard Hinnant 28c1c61ac2 Advertise that this works in C++17 2018-01-08 09:54:42 -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