Jump to content

[SOLVED] HOWTO subtract dates and display result in days


andz

Recommended Posts

Is there any way to display dates in results after subtracting them?

 

echo strtotime($values['bookStart']);

echo '<br /><br />';

echo strtotime($values['bookEnd']);

echo '<br /><br />';

 

$res = strtotime($values['bookEnd']) - strtotime($values['bookStart']);

 

 

date format YYYY-MM-DD

 

$bookStart = '2009-01-02';

$bookEnd = '2009-01-10';

 

the result should return 8 days

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.