mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-02 20:24:27 +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);
|
auto& f = use_facet<time_put<CharT>>(loc);
|
||||||
basic_ostringstream<CharT, Traits> os;
|
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{};
|
std::tm tm{};
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
gmtime_r(&tt, &tm);
|
gmtime_r(&tt, &tm);
|
||||||
|
Reference in New Issue
Block a user