Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Set default timezone in PHP 5.
- if ( function_exists( 'date_default_timezone_set' ) )
- date_default_timezone_set('America/Chicago'); //this overwrite all settings!!
- // it's sooner than one day ago
- $time_left = $time - $one_day_ago;
- $days_left = floor($time_left / 86400); // 86400 = seconds per day
- $hours_left = floor(($time_left - $days_left * 86400) / 3600); // 3600 = seconds per hour
- $mins_left = floor(($time_left - $days_left - $hours_left * 3600) / 60); // 60 = seconds per min
- echo '<b>'.$entry["6.3"].' '.$entry["6.6"].'</b>';
- echo '<br/>Created on: '.date_i18n('M d, Y h:i:s a T', $time);
- $total_time = strtotime('+24 hour', $time);
- echo "<br/>$hours_left hours & $mins_left min remaining";
- echo '<br/>This entry will be deleted on '.date_i18n('M d, Y h:i:s a T', $total_time).'<br/><br/>';
- // Set default timezone in PHP 5.
- if ( function_exists( 'date_default_timezone_set' ) )
- date_default_timezone_set('UTC'); //this overwrite all settings!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement