Skip to content

Instantly share code, notes, and snippets.

@paulozullu
Last active April 3, 2018 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulozullu/e89c0afcb9321672c55860371336641a to your computer and use it in GitHub Desktop.
Save paulozullu/e89c0afcb9321672c55860371336641a to your computer and use it in GitHub Desktop.
Libre Office Calc Tips

Convert UNIX timestamp to date in LibreOffice Calc

As it seems, OpenOffice's "day 0" is December 12th, 1899; that implies that January 1st, 1970 is day 25569 for OpenOffice. Now, if you divide a UNIX timestamp by 86400 (the number of seconds in a normal day), that will give you the number of days between the epoch and that timestamp (and some decimal, that you can use to calculate the time of day). And if you sum that number with 25569, you have an OpenOffice day for that timestamp.

Alright, let's put all the pieces together: let's say cell A2 contains a UNIX timestamp 1341104400, then this formula

=A2/86400+25569

will return a number. And if you format that cell as a date, DD/MM/YYYY HH:MM:SS, then you'll read a pretty "01/07/2012 01:00:00" there.

Find distinct values in Calc

1. Select the entire Range to find distinct rows in ( e.g. "A1:B99" ),
2. Choose the menu "Data : More Filters : Standard Filter...",
3. In the dialog box that appears, in the first row of the Filter Criteria, set the Field Name to "- none -",
4. Expand the Options by clicking on the small triangle, 
5. Check the checkbox "No duplications",
6. Check the checkbox "Copy results to:" and enter a full Target CellAddress into the textbox ( e.g. "Sheet1.D1" ),
7. Uncheck the checkbox "Keep filter criteria",
8. If your source range does not contain a header, uncheck the checkbox "Range contains column labels",
9. If case matters while searching for distinct rows, check the checkbox "Case sensitive",
10. Click OK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment