Through the YT API, I get the date of the video in this format (UTC):
publishedAt: "2015-09-17T00:01:56.000Z"
And on Facebook, inspecting the source code I see that they use:
<abbr title="Quinta, 17 de setembro de 2015 às 06:59" data-utime="1442465986" data-shorten="1" class="timestamp livetimestamp">5 h</abbr>
According to this question :
utime is UNIX_TIMESTAMP from a datetime (UTC) let's say 1402355007 for the UTC datetime of 2014-06-10 00:03:27
I want to compare exactly those two posts (YT and FB), so if you do the following for Facebook date:
var ms = 1442465986 * 1000;
dt = new Date(ms);
console.log(dt)
I get:
Thu Sep 17 2015 06:59:46 GMT+0200 (CEST)
In theory, almost seven hours after YouTube. The CEST is Central European Daylight Time. My doubts are
- How to convert
publishedAt
toutime
and compare the two? - YouTube does not explain which GMT uses , does the reference is + 0000?