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

How to read the csv timestamps in Libreoffice? #3

Closed
maikol-solis opened this issue Nov 8, 2021 · 5 comments
Closed

How to read the csv timestamps in Libreoffice? #3

maikol-solis opened this issue Nov 8, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@maikol-solis
Copy link

I ran some pomodoro sessions, setting the pomm-csv-history-file variable.

The timestamps in the file have the form

timestamp
1636221045
1636221049
1636221055
1636221122
1636221129
1636222121

But if I convert them to date format I get

timestamp
01/22/73
01/26/73
02/01/73
04/09/73
04/16/73
01/03/76

Which are wrong for me.

Is there a way to export the timestamps into a standard way like "%Y-%M-%d %H:%m:%s"?

Thanks.

@SqrtMinusOne
Copy link
Owner

SqrtMinusOne commented Nov 8, 2021

These are UNIX timestamps, that is the number of seconds since 1970-01-01. LibreOffice time is the number of days since 1899-12-30.

So you can use the following formula to convert one to another: =A2/(60*60*24) + 25569. Then select the column and Format > Cells > Number > Date should make the date look like what you expect.

But saving timestamps in a custom format should definitely be an option, I'll add it in the next version.

@SqrtMinusOne SqrtMinusOne added the enhancement New feature or request label Nov 8, 2021
@maikol-solis
Copy link
Author

Thanks!

I'll be looking forward to seeing those new options.

Best.

@SqrtMinusOne
Copy link
Owner

Added. Set pomm-csv-history-file-timestamp-format however you like, the format is the same as in format-time-string.

I've left the default value as "%s" to be backwards-compatible, the format you mentioned should look like "%Y-%m-%d %H:%M:%S"

@maikol-solis
Copy link
Author

Thanks!

@SqrtMinusOne
Copy link
Owner

Feel free to reopen if anything about this part goes wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants