Calculate time between 2 timestamps

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric Rechter

    Calculate time between 2 timestamps

    Hi,

    What's the easiest way in php to calculate the hour and minutes (HH:MM)
    between 2 times? (unix timestamps)

    thanks in advance!

    Eric


  • bobzimuta

    #2
    Re: Calculate time between 2 timestamps

    What's the easiest way in php to calculate the hour and minutes (HH:MM)
    between 2 times? (unix timestamps)
    A Unix timestamp is in seconds. Subtract the two and you have the
    difference between the two in seconds... Need more?

    Comment

    • Blayde

      #3
      Re: Calculate time between 2 timestamps


      bobzimuta wrote:
      What's the easiest way in php to calculate the hour and minutes (HH:MM)
      between 2 times? (unix timestamps)
      >
      A Unix timestamp is in seconds. Subtract the two and you have the
      difference between the two in seconds... Need more?
      It would also be wise to take the absolute value, abs(), of the
      subtraction in case of a negative result
      -Blayde

      Comment

      • Michael Boutros

        #4
        Re: Calculate time between 2 timestamps

        Did you get it to work?

        Comment

        Working...