Welcome Guest, Not a member yet? Register   Sign In
How to show total days from date
#1

I have article function to post an article and I want to show total days after this article is posted. For Example : 
I posted article at 27 June 2024, today is 2 July 2024. In my article will show the information "6 Days Ago"

My type data for date posting is : 
Unix Timestamp (1719853709) it will show 1 July 2024

My question is : 


  1. How to show total hours after submit (1 hours ago, 5 hours ago, 23 hours ago) if the article posted under 24 hours
  2. How to show total date after submit (1 Days Ago, 2 Days Ago, 20 Days Ago, 29 Days Ago) if the article posted under 1 month
  3. How to show total month (1 month ago, 2 month ago, 10 month ago, 11 month ago) if the article posted under 1 years
  4. How to show total years (1 Years Ago) 


Master, please help. Thank you very much.
Reply
#2

See https://codeigniter.com/user_guide/libra...l#humanize
Reply
#3

(07-01-2024, 11:24 PM)kenjis Wrote: See https://codeigniter.com/user_guide/libra...l#humanize

Solved, Thank you
Reply




Theme © iAndrew 2016 - Forum software by © MyBB