Diff in time as varchars

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
If I have two separate times, which are stored as varchars, in HH:mm:ss, how
can I obtain their differences? For example, is there a way to obtain the
time difference between, say '21:10:00' and '03:59:59' ? Thanks, Ike

Re: Diff in time as varchars

Ike wrote:
Quoted text here. Click to load it

See the docs for the TIMEDIFF() function at this web page:

The TIMEDIFF() function was added in MySQL 4.1.1.  If you're using an
earlier version of MySQL, you could fetch both time values and use code
in your application to calculate the difference.  There are libraries
available for any virtually every computer language to perform this type
of calculation.

Bill K.

Site Timeline