Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting time difference

    Anyone know the function to compare two TIMESTAMPS (of 14 digits each) which will return the difference in seconds?

  • #2
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts
    since timestamps are seconds. simply...
    Code:
    echo (timestamp1 - timestamp2);

  • #3
    New Coder
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not 14 digit MySQL timestamps... which is to what I am refering to.

    They come in the following format:

    YYYYMMDDHHMMSS

    eg:

    20040603164500

    This is 3 June 2004, 4:45:00pm

  • #4
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts
    here's a date-time class that may help you

    http://sourceforge.net/projects/phpdatetime/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •