I'm trying to calculate the difference in time between NOW and a time in the past. I won't go too in depth here as far as how my web system (by API) works, but essentially I am returning an array of publication times.
What I want to achieve:
NOW (UTC) - PUBLICATION (UTC) = DIFFERENCE IN SECONDS
The publication time I am returning from my system is already in datetime format YYYY-MM-DD HH:MM:SS
and in UTC time.
I am using this angular-2 module: https://www.npmjs.com/package/angular2-moment
The calculation that is actually being performed at the moment is:
PUBLICATION (UTC) - NOW (NOT IN UTC) = DIFFERENCE IN SECONDS
My HTML:
<td><time>{{nextDay | amDifference: (i['pubDate']):'seconds' : false}}</time></td>
Example of what I want to do:
right now UTC (2018-07-18 14:10:55) - publication time utc (2018-07-18 12:32:51) = 5884 seconds
It must be a matter of switching the piping around in the html, but I can't find any documentation on how the calculation is made, but I replicated my issue in Python and found that it is taking the wrong times from each other. All help greatly appreciated!