Hello koders, i see an amazing thread on Stack overflow where they discuss about showing time ago. im wondering if someone have the idea to implement this on our apps made with kodular.
the thing is that, when someone post something on my app i also store the current date/time when they post. and shows it as like "5 minutes ago, 1 hour ago, 1 day ago, etc by comparing with the current time/date.
im also trying to do this, if worked i’ll post the solution here
i think that was possible to do with time tools and date tools extension, like we can compare difference between time posted and time now , i have tried date tools extension to compare date today and date expiry and that works good show me days left ,
and i have did that without that extension too, by converting time instant to millis and then use math components to - that values , like time posted(converted to millis) - time now(converted to millis)
Why do you need an extension to do a simple math subtraction?
You only need to know the milliseconds of the instant the post was posted and the milliseconds of the current instant. Subtract the first from the second and there! You have how much time passed in milliseconds. Then check if that number is greater than 86400000, then it means days, if not divide it by 3600000 for hours, if not use 60000 for minutes, etc.
Then format it any way you want.
Thanks to everyone who contributed on this thread. i really appreciate it. also a big thanks to @pavi2410 for providing example. i hope many people will find it helpful.
Bro i didn’t understand in some block.where you find epoch block & how can i do that with all list time & date.i think i can understanding you.sorry for poor english.