-
Notifications
You must be signed in to change notification settings - Fork 506
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
LASTSAVE Command to Return Human-Readable Timestamp. #2817
Comments
@SharonIV0x86 Perhaps we could add an option for the |
Something like this? |
Yes, I prefer using the format: |
Sounds good. I'd like to implement this enhancement and I'll also modify the docs accordingly. |
|
Search before asking
Motivation
While i was working with creating backups in the kvrocks i wanted to see the time when the last save was done, i ran the
LASTSAVE
command and it returned the time in the unix epoch timestamp.Solution
I’d like to propose an improvement to the
LASTSAVE
command by using the<ctime>
library to convert the Unix timestamp into a human-readable local time format.Currently,
LASTSAVE
returns the time in Unix epoch format, which requires users to manually convert it to their local time. This can be a bit time-consuming.I have two solutions for this.
1.) Introduce a new command
LASTSAVEH
This command would return the last save time in a human-readable format (e.g.,
2025-03-06 21:54:51
). The existingLASTSAVE
command would remain unchanged, continuing to return the Unix timestamp.2.) Modify
LASTSAVE
to return both formatsInstead of introducing a new command, we could modify
LASTSAVE
to return two values:I am happy to work on this enhancement, if you find my idea relevant kindly assign this to me. 😄
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: