Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions stl/inc/chrono
Original file line number Diff line number Diff line change
Expand Up @@ -6467,8 +6467,9 @@ struct formatter<_CHRONO file_time<_Duration>, _CharT> {

template <class _FormatContext>
auto format(const _CHRONO file_time<_Duration>& _Val, _FormatContext& _FormatCtx) {
const auto _Sys = _CHRONO clock_cast<_CHRONO system_clock>(_Val);
return _Impl._Write(_FormatCtx, _Val, _Fill_tm(_Sys));
const auto _Utc = _CHRONO file_clock::to_utc(_Val);
const auto _Sys = _CHRONO utc_clock::to_sys(_Utc);
return _Impl._Write(_FormatCtx, _Utc, _Fill_tm(_Sys));
}

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ void test_clock_formatter() {
}
}
}

empty_braces_helper(file_clock::from_utc(utc_2016_12_31), STR("2016-12-31 00:00:00"));
empty_braces_helper(file_clock::from_utc(utc_2016_12_31) + 24h, STR("2017-01-01 00:00:00"));
empty_braces_helper(file_clock::from_utc(utc_2021_05_04), STR("2021-05-04 00:00:00"));
// TRANSITION: Test a leap second insertion after 2018-06 when there is one
}

template <typename CharT>
Expand Down