Created
April 25, 2016 22:51
-
-
Save johnpbloch/e67cdd88554349df2c7c14fe43405268 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @var int $start The start timestamp */ | |
/** @var int $end The end timestamp */ | |
$days = ceil( abs( $end - $start ) / DAY_IN_SECONDS ); | |
if ( date( 'Ymd', $start ) !== date( 'Ymd', $end ) ) { | |
$days += 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment