Results 1 to 4 of 4

Thread: time difference

  1. #1
    Join Date
    Nov 2003
    Posts
    11

    Unanswered: time difference

    Does anybody know how to find difference between two times in hours
    for ex 24:00:00 20:00:00 is 4 hours


    thanks in advance

    later

  2. #2
    Join Date
    Sep 2003
    Location
    London
    Posts
    56
    What data type is the column? Do you need this to work for rolling over days,weeks,years?

    A little more info on the actual problem may help.

    Matt.

  3. #3
    Join Date
    Dec 2003
    Posts
    6
    Have you looked at the manual -

    http://www.mysql.com/doc/en/Date_and...functions.html

    check out DATE_SUB,for example. Be real careful about any maniplation that overlaps days, so 1AM - 11PM the next day doesn't return a result you don't want.

  4. #4
    Join Date
    Nov 2003
    Posts
    11
    i did and it suggested me to do this

    i can't use TIMEDIFF() because i have a older version

    then i did this


    Select (UNIX_TIMESTAMP(' EndTime') - UNIX_TIMESTAMP('StartTime')) as TotalMin from newsession";

    now for this need to add date tooo , it is in the datbase but i don know how to put two fields in UNIX_TIMESTAMP()

    i tried like this

    Select (UNIX_TIMESTAMP('t_date EndTime') - UNIX_TIMESTAMP('t_date StartTime')) as TotalMin from newsession";

    but it doesn't work

    any clue on what is wrong here

    thanks anyways
    later
    if u can't impress people with ur intelligence , confuse them with ur bullshit

Posting Permissions

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