The Linux Page

Add or subtract to a Time field in LibreOffice

Today I was working on a spreadsheet where I added a time for a calendar type of sheet.

What I wanted to do is have a column where time increases without having to type each time manually.

So I needed to add 15 or 30 minutes to the first time.

Say my first time is 7am, it appears as 07:00:00 AM.

In the next row (B4), I wanted to do something like:

=B3+"15 minutes"

The fact is that LibreOffice saves time and date as a double number where 1.0 represents 1 day.

So to add just 15 minutes, you need to divide your number by the number of minutes in a day:

=B3+15/60/24

Or if you prefer, you could write it this way:

=B3+15/(60*24)

Similarly, you could add seconds by dividing by another 60. Here I would be adding 5 seconds:

=B3+5/(60*60*24)

Note that this is quite different from the usual Unix timestamp which uses 1 second as its increment value.