mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-01 03:34:26 +02:00
Fix formating of time_points with a resolution finer than system_clock::duration
This commit is contained in:
2
date.h
2
date.h
@@ -4015,7 +4015,7 @@ format(const std::locale& loc, std::basic_string<CharT, Traits> fmt,
|
||||
}
|
||||
auto& f = use_facet<time_put<CharT>>(loc);
|
||||
basic_ostringstream<CharT, Traits> os;
|
||||
auto tt = system_clock::to_time_t(sys_time<Duration>{tp.time_since_epoch()});
|
||||
auto tt = system_clock::to_time_t(time_point_cast<system_clock::duration>(sys_time<Duration>{tp.time_since_epoch()}));
|
||||
std::tm tm{};
|
||||
#ifndef _MSC_VER
|
||||
gmtime_r(&tt, &tm);
|
||||
|
Reference in New Issue
Block a user