MySQL Forums
Forum List  »  PHP

Re: How to calculate time difference
Posted by: Felix Geerinckx
Date: November 02, 2006 09:45AM

janakiraman t Wrote:

> select TIMEDIFF ('2006-10-31 11:50:31' , '2006-10-31 11:50:01')

> but it is saying you have an error in sql syntax.
> Iam using mysql 4.1.0 version.

TIMEDIFF() is available from MySQL 4.1.1 onwards.

Try
select UNIX_TIMESTAMP('2006-10-31 11:50:31') - UNIX_TIMESTAMP('2006-10-31 11:50:01')

And you shouldn't put a space between a function name and the opening parenthesis.

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
Re: How to calculate time difference
November 02, 2006 09:45AM
d d
November 19, 2008 01:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.