We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello. I love using your library.
I saw this issue but it was closed. Here is my usecase of time_point:
class record { std::chrono::time_point<std::chrono::system_clock> last_modified, ...; void init() { last_modified = std::chrono::system_clock::now(); } void expired() { return ((std::chrono::system_clock::now() - last_modified) > std::chrono::hours(8)); } // Bunch of other operations that add/subtract duration to another time_point member. };
I want to implement a print() that displays the time_point members. Here is what I do now:
print()
void print() { const auto time_c = std::chrono::system_clock::to_time_t(last_modified); std::cout << std::ctime(&time_c); }
I would like to use fmt::print("{}", last_modified) and be done with it. Could you please consider my request?
fmt::print("{}", last_modified)
The text was updated successfully, but these errors were encountered:
Sure, a PR is welcome.
Sorry, something went wrong.
Add formatters for chrono::time_point<system_clock> (#1837)
f39e6fb
Add formatters for chrono::time_point and helper overloads for localtime/gmtime(time_point) Fixes #1819
Successfully merging a pull request may close this issue.
Hello. I love using your library.
I saw this issue but it was closed. Here is my usecase of time_point:
I want to implement a
print()
that displays the time_point members. Here is what I do now:I would like to use
fmt::print("{}", last_modified)
and be done with it. Could you please consider my request?The text was updated successfully, but these errors were encountered: