Skip to content

Instantly share code, notes, and snippets.

@SirDarcanos
Created August 23, 2016 10:08
Show Gist options
  • Save SirDarcanos/dc079ed5058cf397f9dad50d7759ca7e to your computer and use it in GitHub Desktop.
Save SirDarcanos/dc079ed5058cf397f9dad50d7759ca7e to your computer and use it in GitHub Desktop.
// 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