2
Through the YT API, I get the video date 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 the Facebook date:
var ms = 1442465986 * 1000;
dt = new Date(ms);
console.log(dt)
Obtenho:
Thu Sep 17 2015 06:59:46 GMT+0200 (CEST)
In theory, almost seven hours after Youtube. CEST is the summer time of Central Europe. My doubts are
- how to convert the
publishedAt
inutime
and compare the two? - o Youtube does not explain which GMT uses, is the reference +0000?
Only that
return d1 > d2
that has to be adjusted.– brasofilo