473,387 Members | 1,553 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,387 software developers and data experts.

conversion of datetime to integer

I am trying to figure out the average time it takes to complete an event, so I need to convert my datetime to an integer. I am not sure how to do this. I was also wondering once this conversion is done, will I be able to do an average?
May 15 '07 #1
1 6250
pbmods
5,821 Expert 4TB
Heya, amberz0389. Welcome to TSDN!

You'll probably like the TIME_TO_SEC function:

Expand|Select|Wrap|Line Numbers
  1. mysql> SELECT TIME_TO_SEC('01:15:45');
  2.  
  3. +-------------------------+
  4. | TIME_TO_SEC('01:15:45') |
  5. +-------------------------+
  6. |                    4545 | 
  7. +-------------------------+
  8.  
http://dev.mysql.com/doc/refman/5.0/...on_time-to-sec
May 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nikola | last post by:
Hi all, I have a problem converting datetime to integer (and than back to datetime). Depending whether the time is AM or PM, same date is converted to two different integer representations,...
4
by: DWW | last post by:
System.DateTime returns a string with the date and time. I want to convert the time to an integer, for example, convert 10:24:45 to 102445. Much research has turned up a myriad of variations on...
4
by: TJS | last post by:
when converting this to VB, the result fails , can anyone help ? C# private void CreateDayEffects(object sender, System.Web.UI.WebControls.DayRenderEventArgs e) { e.Cell.Attributes =...
4
by: Piotr Karwatka | last post by:
Hi! I have a little problem - i have an integer value with contain a number of some day in current day (for example 56) - and my problem is - how can i caonvert this integer value to DateTime...
8
by: William Foster | last post by:
Good afternoon all, I am trying to convert a date to an integer in Microsoft Visual Basic 2003 .NET and am experiencing a little trouble trying to get it done. This is what I want to do: ...
5
by: kyosohma | last post by:
Hi, I am populating a mySQL database with data from the MS Access database. I have successfully figured out how to extract the data from Access, and I can insert the data successfully into mySQL...
4
by: SAL | last post by:
I'm sorry if this has been answered before but I didn't see it in a quick scan of the list. The following code is causing an error when the field is null: Error text: Conversion from type...
5
by: Ivan Velev | last post by:
Hello, Minimal example below - it gives me different output if I comment / uncomment the extra time.mktime call - note that this call is not related in any way to main logic flow. When...
1
Manikgisl
by: Manikgisl | last post by:
But the problem is we have dates in Varchar instead Datetime While Converting Varchar To Datetime All four formats are unable to Convert ie select Convert(Datetime,'18-11-2008 2:35:19...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.