Current location: Hot Scripts Forums » Programming Languages » PHP » Need help for time difference


Need help for time difference

Reply
  #1 (permalink)  
Old 05-19-08, 05:06 AM
irfan irfan is offline
New Member
 
Join Date: May 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Need help for time difference

hi,

i have date value which is stored in MySQL DB.

and i get that through array i.e $row['Date'] and displayed on form

and the other date is current date which i got from function date('d','m','y').

now i want to get the difference of both dates to calculate the rent.

but i could not yet.

i don't know i am doing wrong or right.

can anyone please help me.

regards.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-19-08, 05:36 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
what does the date in the database look like?
Have a look at the strptime and the strftime functions, it's often easier to work with times instead of dates
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference in hours / minutes End User PHP 9 04-01-08 06:35 AM
difference between typedef and #define KSB C/C++ 1 10-09-06 05:34 PM
Difference between the user control and Custom server controls bhar ASP.NET 0 07-22-06 06:42 AM
Difference between <%! and <% when declaring variables in .jsp flekso Everything Java 1 09-10-04 10:09 AM
Calculating time difference rocky PHP 2 07-17-04 03:48 PM


All times are GMT -5. The time now is 06:41 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.