mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 08:31:03 +08:00
Test for utc during leap second insertion
This commit is contained in:
parent
aa0494b980
commit
b86def339e
@ -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};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user