SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Subract two timestamp
-
May 7, 2009, 01:48 #1
- Join Date
- Jun 2008
- Posts
- 205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Subract two timestamp
How to calculate the difference of two timestamps and display output in
hrs, ..... minutes and .....Secs
-
May 7, 2009, 01:51 #2
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Just arithmetic.
Unix timestamps are numbers of seconds
The difference between two timestamps is also a number of seconds
The number of hours is the number of seconds divided by (60 minutes * 60 seconds = 360)
The number of minutes is the number of seconds, minus those hours, divided by 60
The number of seconds is the number of seconds, minus those hours and minutes
Round each value down to remove the fractional partsTry Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
May 7, 2009, 01:54 #3
- Join Date
- Apr 2009
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
$diff=date("Y-m-d",strtotime(༽-01-2007') - strtotime(༽-01-2008'))
try this out........
-
May 7, 2009, 01:56 #4
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
Bookmarks