Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: "Human readable time" now shows milliseconds correctly. #67

Merged
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
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