Created
August 23, 2016 10:08
-
-
Save SirDarcanos/dc079ed5058cf397f9dad50d7759ca7e 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
// Difference for between now and a date in the future | |
$future_timestamp = strtotime( '1st January 2020' ); | |
$difference = human_time_diff( current_time( 'timestamp' ), $future_timestamp ); | |
// Difference between a date in the past and now | |
$past_timestamp = strtotime( '1st January 2016' ); | |
$difference = human_time_diff( $past_timestamp, current_time( 'timestamp' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment