Thread: time difference

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    6
    Rep Power
    0
    I have to calculate time difference using sql statements in MySQL. Can somebody please tell me the syntax for it.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Annapolis, Maryland US
    Posts
    113
    Rep Power
    16
    There are many different time manipulation functions for valid datetime columns - just check on MySQL's online manual.

    A personal favorite is the to_days() function....

    > select * from table_name
    > where to_days(now())-to_days(activity_date)
    > <= 7;

    // show me all the activities that occurred within the last week.
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    thane
    Posts
    50
    Rep Power
    0
    yaar amit

    wht exaclty is ur requirement ?

    wht time diff u wanna measure?

    to_days() is always a good option ..

    give some more details like wht do u want

    ranjeet walunj

Similar Threads

  1. Automatically update date and time
    By thehen in forum ASP Programming
    Replies: 3
    Last Post: October 18th, 2003, 09:41 PM
  2. is there any time dependency client side
    By aravind2611 in forum PHP Development
    Replies: 13
    Last Post: September 1st, 2003, 12:27 AM
  3. time Problem
    By zuzupus in forum PHP Development
    Replies: 0
    Last Post: July 17th, 2003, 05:02 AM
  4. Replies: 8
    Last Post: July 14th, 2003, 03:08 PM
  5. Calculating time difference in seconds?
    By Saus in forum PHP Development
    Replies: 1
    Last Post: June 3rd, 2003, 09:34 AM

IMN logo majestic logo threadwatch logo seochat tools logo