Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 4th, 2007, 08:23 AM
Registered User
 
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hozyali
Default time calculation

Hi,

I have a problem with a time calculation issue.

What I am trying to do is I have a mysql table with some specific times, like 8:00am, 8.30am etc etc.

Now I have another table which contains duration time for two specific places. like place1 & place2 = 45 minutes

Now I want to fetch the value of first table and minus the value of 2nd table. like 1st is 8.00am and 2nd is 45 minutes, so the result should be 7:45am

Can some one please let me know how can I do this with PHP?

Regards
Ali

www.starcomsystems.net
www.starcomhosting.net
 
Old April 6th, 2007, 10:11 AM
Authorized User
 
Join Date: Feb 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi hozyali,

have u tried to use the mysql functions ADDDATE() and ADDTIME(). I believe they could come to your help,and it would be much easier and quick as compared to doing the same in php.

 
Old April 9th, 2007, 08:02 AM
Registered User
 
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hozyali
Default

Quote:
quote:Originally posted by Manu Sharma
 hi hozyali,

have u tried to use the mysql functions ADDDATE() and ADDTIME(). I believe they could come to your help,and it would be much easier and quick as compared to doing the same in php.

can you tell me how exactly to do that?

Ali

www.starcomsystems.net
www.starcomhosting.net
www.articlesbank.net
www.templatesbank.net





Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Difference Calculation deepak_7k Access 3 November 29th, 2006 08:36 PM
Time Calculation surendran MySQL 1 June 24th, 2006 01:38 PM
Time calculation rdfernandez Access VBA 6 March 24th, 2005 11:51 AM
client side time calculation in asp.net gmk51080 Javascript 0 November 30th, 2004 04:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.