Hi,

I have two datetime fields in mySQL table.

How do I compare them so I know for example:

compare two datetime fields to find out if one is within 5 hours of the other, or within 7 days of the other.

I have a user table which records when it's the last datetime the user logged in. Say if he last logged in at 8/25/2005 12:30AM. Then My PHP script will check the current system time say now is 8/25/2005 7:30PM. I want to compare these 2 datetime to know if user was last logged within 5 hours of now.

(I'm a newbie, I could not find some decent datetime tutor around)

Thanks a lot.

    rvpals wrote:

    (I'm a newbie, I could not find some decent datetime tutor around)

    Thanks a lot.

    [man]date/man is a pretty good start 😉

      Write a Reply...