Skip to content

Commit

Permalink
Fix: "Human readable time" now shows milliseconds correctly. (#67)
Browse files Browse the repository at this point in the history
Co-authored-by: David Anthony <djanthony@gmail.com>
  • Loading branch information
rasmusan and danthony06 authored Sep 27, 2024
1 parent fbf46f0 commit 2c10d38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/log_database_proxy_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ QVariant LogDatabaseProxyModel::data(
if (human_readable_time_) {
char date_str[std::size("yyyy-mm-dd hh:mm:ss")];
const time_t time = static_cast<time_t>(item.stamp.seconds());
int32_t milliseconds = static_cast<int>(1000.0 * (item.stamp.seconds() - static_cast<double>(item.stamp.seconds())));
int32_t milliseconds = static_cast<int>(1000.0 * (item.stamp.seconds() - std::floor(item.stamp.seconds())));
std::strftime(std::data(date_str),
std::size(date_str),
"%F %T",
Expand Down

0 comments on commit 2c10d38

Please sign in to comment.