Converting Time

This is a discussion on "Converting Time" within the Databases section. This forum, and the thread "Converting Time are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old May 28th, 2007, 13:01
Junior Member
Join Date: Feb 2007
Location: Wirral
Age: 13
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Converting Time

Hi All,

I am currently working on a website which has a form, the form sends some details into a table called 'reports'. It assigns a variable for the current total hours (which is located in a table called 'pilots') and then takes 1 field from the form (Duration) and adds it to this variable number (TotalHours). It then updates the TotalHours in 'pilots' with the new total hours. The problem is that we have to convert the duration into decimals each time we fill in the form, how do I change the times (00:00:00) into decimals(00.00), add the two decimals together and then convert it back into a time format(00:00:00) for when it is shown on a roster page using PHP/MYSQL?

Any help much appreciated, if you want access to the code just say and I will send it over. Or if you don't understand a word I just typed, I can have a go at making it a bit simpler:P

Mike

Last edited by Michaeln; May 28th, 2007 at 13:37.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 3rd, 2007, 13:34
New Member
Join Date: Feb 2007
Location: Vancouver
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Converting Time

There shouldn't be a conversion to decimal, use the date and time functions already built in to mysql. Here's a link to the ADD part:

http://dev.mysql.com/doc/refman/5.0/...nction_addtime
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
my sql, time

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting this to css..... jahphill Web Page Design 3 Jun 9th, 2008 11:19
converting an swf into an fla danny322 Flash & Multimedia Forum 5 Feb 2nd, 2008 08:32
converting to css sliz Web Page Design 5 Aug 28th, 2007 14:30
Converting Doc to PDF or TXT to PDF on Upload ChipperT ASP.NET Forum 0 May 10th, 2005 20:29
Adjusting time from server time to local time Tim356 Classic ASP 10 Jun 21st, 2004 14:57


All times are GMT. The time now is 23:04.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42