开发者

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 :(

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜