Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in PHP only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
PHP
Time difference in PHP
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
sbettadpur
New Member
Join Date:
Aug 2007
Posts:
121
#1
Time difference in PHP
Sep 6 '08, 04:33 AM
How to get the difference between two times considering AM and PM situation in PHP?
dlite922
Recognized Expert
Top Contributor
Join Date:
Dec 2007
Posts:
1586
#2
Sep 6 '08, 06:32 AM
what is the format of the time already? Do you have the time (hour, min) in variables or in a string?
If variables: see mktime()
if string: see strtotime()
...in the php manual.
Dan
Comment
Post
Cancel
charles07
New Member
Join Date:
Dec 2011
Posts:
45
#3
Jan 13 '12, 10:42 AM
if it's mysql use timediff function
SELECT TIMEDIFF('2010-10-22 10:50:10','2010-10-22 10:27:10') AS timedifference
above query gives the answer 00:23:00
Comment
Post
Cancel
abhijeet1
New Member
Join Date:
Jan 2012
Posts:
11
#4
Jan 13 '12, 12:47 PM
Use this code in your timing code section.
strtotime("+30 minutes")
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment