Get relative time from Epoch (Unix) time

I have the Unix time in seconds, how do I get the Relative time?
I needed something like ‘4 days ago’.

Any idea how do I go about it?

4 Likes

On a more serious note, epoch time is given in seconds, so if you need to find out the time for 4 days ago, for instance, then all you need to do is remove 4 days worth of seconds.

Okay, thanks!

You should check out LuaDate.

Not sure if that was the best link for documentation though. You could take a look here too: https://tieske.github.io/date/

Or just google for LuaDate. :slight_smile:

Anyway, I’ve been using this library and it’s been working perfectly for me.

1 Like