doutan1671 2013-10-02 11:53
浏览 57

将我的日期转换为小时和天数[重复]

This question already has an answer here:

Hi i need covert date to hours and days

My date format is like this : 2013-09-01 22:15:59

I need to show like this within 24 hours (hours) :(12 hours back)

I need to show like this after 24 hours (days) :(5 days back)

</div>
  • 写回答

1条回答 默认 最新

  • dsgnze6572 2013-10-02 12:07
    关注

    Use example :

    echo time_elapsed_string('2013-05-01 00:22:35');
    echo time_elapsed_string('2013-05-01 00:22:35', true);
    

    Output :

    4 months ago
    4 months, 2 weeks, 3 days, 1 hour, 49 minutes, 15 seconds ago
    

    Link to the function.

    评论

报告相同问题?