* The get_info functions were not prepared for the case where the start
and end times of a rule are chronologically reversed for a year. I.e.
the daylight saving start comes later in the year than the daylight
saving end. When save is positive, this happens in the southern
hemisphere (e.g. "Australia/Sydney" -> "AEST-10AEDT,M10.1.0,M4.1.0/3").
It also happens in the nothern hemisphere when the save is negative
(e.g. "Europe/Dublin" -> "IST-1GMT0,M10.5.0,M3.5.0/1").
* Added tests for Posix::time_zone.
The NVCC compiler fails to compile the date library due
to a compiler bug which causes it to emit an error when
directly using std::ratio_{multiply,divide} in the template
instantiations for std::duration. This PR works around the
issue by introducing custom ratio_{multiply,divide} which
delegate to the standard library templates
Added OnlyLValueString test case that shows the problem with
current impl. Implemented the change, that accept TimeZonePtrOrName
by forwarding reference (to preserve value category), and
merged time_zone selection into one trait.
* 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;
* Added new overloads for operator+/- between year_month and duration
that is convertible to years, so it is better candidate for operands
that are convertible to both years and months. To preserve
functionality, this operator is conditionally noexcept.
* Reworked year_month_day, year_month_day_last, year_month_weekday,
and year_month_weekday_last.
* Added tests for this new functionality.
Change the implementation, in the way that mismatch in return
type of the from/to_sys/utc functions (not returning time_point,
or returning time_point with inappropriate clock) leads to
hard error.
Added appropariate fail test for to_sys function, including:
* returning an int
* returning time_point of wrong clock
* reutrning reference to time_point
Added test that detects if clock_cast<Dest>(Source) properly
SFINAEs if clock's are not castable, this includes test for
steady_clock that is not castable to any wall-clock.
Secondly added steady_based_clock based on steady_clock
(as name indicates), that clock_cast may be extended to clock
non-related to wall-time (sys/utc) using conversion traits.
Final example is pair of ambiguous clocks (amb1/amb2_clock) that can convert
to each other either using sys_clock or utc_clock.
Then the conversion from amb2 to amb1 is disambiguated
via trait specialization.
Created mil_clock and s2s_clock, that are both using to_sys/from_sys
function and are fully interoperable with existing clocks (including
ones based on utc).
Implemented an trait is used to provide direct conversion
from s2s_clock to mil_clock without converting to sys_clock
(conversion counter is used for this purpose).
Implemented test for conversions between existing clocks
(sys_clock, utc_clock, tai_clock, gps_clock) showing that
they can be used instead of to_clock_time functions.