473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Diff in time as varchars

Ike
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
Sep 5 '05 #1
1 1747
Ike wrote:
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


See the docs for the TIMEDIFF() function at this web page:
http://dev.mysql.com/doc/mysql/en/da...functions.html

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.

Regards,
Bill K.
Sep 6 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: python | last post by:
Hi- I have a lot of monthly time series data. I need to be able to compare two dates and get the number of months that they are apart. The datetime module is a daily-frequency data type. ...
0
by: Dan Anderson | last post by:
I am curious about the internal representation of VARCHARS. I cannot find any documentation on it in the mySQL manual. Will a VARCHAR(10) take up less space then a VARCHAR(80), even though they...
2
by: Miles Ashton | last post by:
A common request for enhancement to applications is to "make this field bigger". I know I've been caught with increasing a field size, and then spending hours debugging because another stored proc...
3
by: parksch2 | last post by:
I have been trying and trying to properly sort records through a mySQL query. I have hour, minute and AM/PM values stored separately in a database as varchars. I'm trying to concat those, cast them...
9
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the...
4
by: Shane D. | last post by:
I have tried contacting the list owner, but nobody responds so I am knowingly sending administrative mail to the list. Sorry folks. For months, particularly since February, I have been...
1
by: Bjørn T Johansen | last post by:
I have the following select: select to_char((Log_Fortrykk.SistePlate::time - OrdreNew.SistePlate::time)::interval,'HH24:MI') as diff from Log_Fortrykk I need the output to be HH:MM, e.g....
4
by: Andreas Kasparek | last post by:
Hola! I'm preparing my master thesis about a XML Merge Tool implementation and was wondering if there is any open standard for XML diff regarding topics like: - is a diff result computed on...
6
by: Aaron Gray | last post by:
Hi, I am working on an HTML WYSISYG Wiki and need to display a diff page like WikiPedia does if two people edit a file at the same time to give the second user the diff. Basically with additions...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.