Skip to content

Instantly share code, notes, and snippets.

@ddliu
ddliu / date_diff.php
Created May 31, 2011 05:45
get date difference
<?php
function getDateDiff($date)
{
$diff_info=array();
$timestamp=strtotime($date);
$timestamp_diff=$timestamp-time();
//test if $date is future
$diff_info['future']=$timestamp_diff>0;