0

I have a posts table in the database, and the table contains datetime row.

I want to convert the datetime to ago format like facebook does.

Thanks in advance.

1
  • 1
    Show us what have you done so far. Commented Sep 21, 2021 at 17:35

1 Answer 1

3

You can use the diffForHumans(); method, in the blade view file. for example:

$post->datetime->diffForHumans();

I hope it works!

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, it works. Thank you very much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.