Skip to content

Fix issue that converted a unix timestamp to from nanoseconds to seconds twice #194

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

Merged
merged 1 commit into from
Apr 24, 2024
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
3 changes: 1 addition & 2 deletions lib/CIndexStoreDB/CIndexStoreDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,7 @@ indexstoredb_timestamp_of_latest_unit_for_file(
// https://en.cppreference.com/w/cpp/chrono/system_clock most implementations use Unix Time.
// Since C++20, system_clock is defined to measure time since 1/1/1970.
// We rely on `time_since_epoch` always returning the nanoseconds since 1/1/1970.
auto nanosecondsSinceEpoch = timePoint->time_since_epoch().count();
return static_cast<double>(nanosecondsSinceEpoch) / 1000 / 1000 / 1000;
return timePoint->time_since_epoch().count();
}
return 0;
}
Expand Down