The Arcive of vBulletin Modifications Site. |
|
Help with dates Details »»
|
|||||||||||||||||||||||||
can anyone tell Me what code i need to use to subract two dates and come up with the number of day's hours minutes sec's in between?? i can;t seem to get anything to work
thanks in advance --jsell Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Let's say your two variables containing the seperate dates, which would be retrieved from a database query, are called $date1 and $date2. We will assume $date1 to be the more recent date.
Here is a basic way: PHP Code:
Quote:
Here is with months included: PHP Code:
And here is a more flexible way giving you to do whatever with each time variable: PHP Code:
|
|
#3
|
|||
|
|||
|
Thanks Velocd!
that gave exactly what Ineeded! I appriciate your help--jsell |
![]() |
|
|