Commit Graph
14 Commits
Author SHA1 Message Date
Howard Hinnant 5eb10b747f Unify and simplify fractional decimal seconds formatting
* Many of the ideas and some of the code herein is credited to
  Adrian Colomitchi

* Decouple fractional decimal seconds formatting from time_of_day
  formatting so that it can be more easily used elsewhere in the
  future.

* Include super-second durations such as nanocenturies and
  microfortnights in the class of durations that will get formatted
  with fractional decimal seconds.

* If a duration is exactly representable with fractional decimal
  seconds not exceeding 18 decimal fractional digits, format it
  exactly.  Otherwise format it to 6 fractional decimal digits
  (microseconds precision).  The number 18 is chosen as this is the
  limit of std::ratio using 64 bits (i.e. atto).

* The above bullet implies that durations with ratio<1, 4> will now
  be formatted with 2 fractional decimal digits instead of 1.
  ratio<1, 8> will be formatted with 3, and ratio<1, 3> with 6.

* Unify the implementation into one C++11 implementation that works
  equally well with C++14.

* Drive-by fix a couple formatting bugs dealing with negative
  durations.

* Deprecate the make_time functions taking unsigned md by removing
  their documentation.  Also deprecate the corresponding time_of_day
  constructors taking unsigned md.

* This change paves the way for future formatting improvements.
2016-11-24 19:54:20 -05:00
Howard Hinnant ae68278245 Add unary operators + and - to year 2016-10-19 12:01:51 -04:00
Howard Hinnant bcdf8acb8b Add trivial default constructors to most calendar types 2016-09-13 20:15:24 -04:00
Howard Hinnant 47b51473c5 Move formatting and parsing
Moved formatting and parsing of sys_time and local_time from tz.h to
date.h in order to make this functionality available to a wider
audience.  Existing code does not need to change.  But future code
can #include "date.h" instead of "tz.h" and need not compile tz.cpp nor
link to curl.

Formatting zoned_time remains in tz.h.
2016-08-24 20:56:17 -04:00
Howard Hinnant 48d61f2631 Add type diagrams. 2016-06-27 22:36:48 -04:00
Howard Hinnant d3eb177cdc 'Update' copyright. 2016-06-09 22:28:52 -04:00
Howard Hinnant b3b39b0ae6 Support wide streams 2016-05-29 00:15:20 -04:00
Howard Hinnant c005648049 Fix type-o's 2016-05-28 14:10:30 -04:00
Howard Hinnant 52485c8403 Make construction from local_days explicit 2016-05-21 12:45:43 -04:00
Howard Hinnant 3758c23251 Continue bringing documentation up to date. 2016-05-21 10:15:58 -04:00
Howard Hinnant 89471a05c4 Continue bringing documentation up to date. 2016-05-15 22:48:52 -04:00
Howard Hinnant e3387fc21d misc cleanup 2016-05-07 16:29:13 -04:00
Howard Hinnant 2f020e2654 Added local_time, and renamed day_point to sys_days 2016-05-07 16:05:21 -04:00
Howard Hinnant 105bd7df89 Initial commit 2016-05-04 20:43:02 -04:00