Libre office calc - hours between two dates

hi all.

got an easy one for you :slight_smile:

so i’m just trying to calculate the number of hours between two dates/times

example
cell 1 = date 1
cell 2 = time 1 pst
cell 3 = date 2
cell 4 = time 2 est

the first tricky part is that the first date/time is pst, 2nd is est

and then i need the result to be in the number of hours between the 2 dates.times

i really couldn’t figure it out. any ideas?

thx

  1. Please clarify additionally if you can assure that cell2 and cell4 contain time-only values.
  2. Can you also assure that cell1 and cell3 contain date-only values?
  3. Why don’t you use date-time values for start and end?
  4. Am I right supposing that pst is meant to mean PacificStandardTime, est EasternStandard time?
  5. Is the time difference between the two satndards assured to be exactly the same independent of DST follies?
  6. Are cell2 and cell4 containing DOT values based on the unit day or are the “numbers of hours since last midnight”?
    Is the first pair the starting time and the second pair the endtime - or the other way?
    Attaching a (reduced) example of your sheet (NO IMAGE!!) would save a löot of clarifications.

thx k,

heres your answers l;

Please clarify additionally if you can assure that cell2 and cell4 contain time-only values.
Can you also assure that cell1 and cell3 contain date-only values? yes
Why don’t you use date-time values for start and end? i don't know what u mean
Am I right supposing that pst is meant to mean PacificStandardTime, est EasternStandard time? yes
Is the time difference between the two satndards assured to be exactly the same independent of DST follies? does dst mean daylight savings time, if so, i have no idea
Are cell2 and cell4 containing DOT values based on the unit day or are the “numbers of hours since last midnight”? i don't know what dot means
Is the first pair the starting time and the second pair the endtime - or the other way? the first one you wrote
Attaching a (reduced) example of your sheet (NO IMAGE!!) would save a löot of clarifications.

You can do
=(cell1 + cell2 + TIME(3,0,0)) - (cell3 + cell4)
to get the difference as long as the sheet knows those are date and time cells. The TIME(3,0,0) adds three hours to the PST time to make it consistent with the EST time.

The tricky part is that this doesn’t account for is daylight savings time, in case that matters to you. To fully account for that you would need to know if locations in question use daylight savings at all, and check to see if it is in force during the date/time in the cells, which gets a lot more complicated