How can i display seconds ago/minutes ago/with unix timestamp?

后端 未结 3 1546
后悔当初
后悔当初 2021-01-26 08:13

I need the unix timestamp - the timestamp i have. Then display the time between like on twitter.

3条回答
  •  悲&欢浪女
    2021-01-26 09:01

    Use example :

    echo time_elapsed_string('@1367367755');
    echo time_elapsed_string('@1367367755', true);
    

    Output :

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

    Link to the function.

提交回复
热议问题