Quote:
Originally Posted by mrthumbs
Is there a quick way to determine if a certain date is Tomorrow or Yesterday?
|
function whichDay($d)
{
if (date('dmY',time()+86400)==date('dmY',$d)) return 't';
if (date('dmY',time()-86400)==date('dmY',$d)) return 'y';
if (date('dmY',time())==date('dmY',$d)) return 'n';
return '';
}
returns t for tomorow, y for yesterday, n for same day and empty string for others...
param must be an unix timestamp, for conversion see PHP mktime function...