Getting the relative date from a Timestamp (i.e. Today, Tomorrow)
I was wondering if PHP has a built in function to return the relevance of a date. For example:
$timestamp = time();
$other = time()+86400;
echo rel_date($times开发者_Python百科tamp); //prints Today
echo rel_date($other); //prints Tomorrow
I know it's pretty simple functionality to build but I don't want to be reinventing the wheel!
As far as I know there is no built in function that has a format option which ouputs "Today", "Yesterday", "Tomorrow", etc..
I've made them myself because of this anyway. It seems you'll need to build it yourself after all, sorry :(
精彩评论