Wrox Programmer Forums
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To 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 September 20th, 2004, 01:58 AM
Authorized User
 
Join Date: Aug 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to spraveens
Default Time difference

Hi

I have 2 time values ,i.e. 11:09 am and 11:45 am stored in 2 variables, Now How do I get the difference between these two values i.e. 36 minutes?

Thanks
Praveen.

 
Old September 20th, 2004, 02:19 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Dear Praveen tel me that which database are you using for getting time or you getting time from any client side script ?



Numan
--------------------------------------------------
Love is the most precious thing of this world. So find it and grab it!
 
Old September 20th, 2004, 02:35 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Cross-post with: http://p2p.wrox.com/topic.asp?TOPIC_ID=19374
Please post replies there.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old September 20th, 2004, 06:31 AM
Authorized User
 
Join Date: Aug 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to spraveens
Default

Thx for the reply , [Iam using sql server 2000]
My dates are : 04:41:23 1-20-2004 , the Unix Time stamp is :1095635478,
04:19:40 1-20-2004 , the Unix time Stamp is : 1095677340 Now I would like to have the Difference of the above 2 unix time stamps, ideally I should get 22 minutes ,when I subtract the second value from the first one I get a value of -41862 [a negative value] . Please let me know How do I get the correct difference and also if Iam wrong any where.
Thx.
Praveen

 
Old September 20th, 2004, 07:00 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Don't cross-post. It's annoying. Anyone who cares enough about your question to answer is likely already subscribed to all of the PHP forums.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Get Difference timing Between Two Time smmedicals Pro VB Databases 1 August 11th, 2008 01:57 PM
Calculating a time difference SQLScott SQL Server 2005 11 October 25th, 2007 02:42 AM
difference in time MunishBhatia ASP.NET 2.0 Professional 0 September 5th, 2007 09:03 AM
Time Difference Calculation deepak_7k Access 3 November 29th, 2006 08:36 PM
find time difference? possible using Asp? blueguy Classic ASP Basics 5 January 23rd, 2006 04:49 AM





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