Skip to content

Commit 292600c

Browse files
committed
utc_clock::to_sys() のコード例を修正
from_sys(), to_sys() の戻り値型の duration は seconds との共通型になるので、この場合戻り値型は sys_seconds になります。
1 parent b342e52 commit 292600c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reference/chrono/utc_clock/to_sys.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ using namespace std::chrono;
3232
int main()
3333
{
3434
auto u = utc_clock::from_sys(sys_days{July/1/2015});
35-
sys_days t = utc_clock::to_sys(u);
35+
sys_seconds t = utc_clock::to_sys(u);
3636
37-
auto leap_seconds = duration_cast<seconds>(u.time_since_epoch() - t.time_since_epoch());
37+
auto leap_seconds = u.time_since_epoch() - t.time_since_epoch();
3838
3939
std::cout << u << std::endl;
4040
std::cout << t << std::endl;
@@ -44,6 +44,7 @@ int main()
4444
* to_sys[color ff0000]
4545
* from_sys[link from_sys.md]
4646
* sys_days[link /reference/chrono/sys_time.md]
47+
* sys_seconds[link /reference/chrono/sys_time.md]
4748
* July[link /reference/chrono/month_constants.md]
4849
* time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md]
4950

0 commit comments

Comments
 (0)