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.
|
|
|
|
|
![]() |
||
Converting Time
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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. |
|
|
|
|||
|
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 |
![]() |
| Tags |
| my sql, time |
| Thread Tools | |
|
|
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 |