Kind of going in circles here. I have an API returning the unix timestamp. I need to convert that in seconds from now to the actual date. For example, if given an epoch time of 1634578318, I need the number of seconds for the difference between now and Monday, October 18, 2021 5:31:58 PM.
No need to format it beyond that. I'm stumbling on a lot of posts and documentation regarding human readable format, but just need the seconds.
You can simply get the unix time from
moment().unix()
Then substract it from the timestamp of your api call - that's it.