I am newbie in learning coding,
hi i want to show show the post created time like 2hours ago or 30 minutes ago like that, how to do that i only have the created time like 2023-01-13 10:35:52", how to convert that with current time or day
I am newbie in learning coding,
hi i want to show show the post created time like 2hours ago or 30 minutes ago like that, how to do that i only have the created time like 2023-01-13 10:35:52", how to convert that with current time or day
2
Answers
you can use the difference method on date and time which give you the difference
from that you can get the difference in hours difference in minutes etc
check the timeago package, it helps implementing what you need