Test for utc during leap second insertion

This commit is contained in:
Tomasz Kamiński 2018-06-10 23:43:12 +02:00 committed by Howard Hinnant
parent aa0494b980
commit b86def339e

View File

@ -29,7 +29,6 @@ main()
assert(st.time_since_epoch() == seconds(946684800)); assert(st.time_since_epoch() == seconds(946684800));
} }
/// utc epoch /// utc epoch
{ {
auto lu = local_days{1970_y/01/01_d}; auto lu = local_days{1970_y/01/01_d};
@ -38,6 +37,14 @@ main()
assert(ut.time_since_epoch() == seconds(0)); assert(ut.time_since_epoch() == seconds(0));
} }
// utc leap second
{
auto lu = local_days{2015_y/07/01_d} - milliseconds(1);
auto ut = clock_cast<utc_clock>(lu) + milliseconds(50); //into leap second
assert(clock_cast<local_t>(ut) == lu);
}
/// utc paper example /// utc paper example
{ {
auto lu = local_days{2000_y/01/01_d}; auto lu = local_days{2000_y/01/01_d};