I found reddit created and created_utc kinda weird to me. Can someone explain to me what am i missing here? When i'm subtracting comment creation date with new Date() i'm getting time from 2 weeks ago instead of date from 3 hours ago (for utc+2 timezone at 2 pm).
fetch(`https://www.reddit.com/r/hearthstone/comments/6kkoyi.json`)
.then(res => res.json())
.then(res=>{
const comments = res[1].data.children.map(obj => obj.data);
let date = comments[0].created
console.log("Should show: Saturday, 1 July 2017 11:13:39 or ~3 hours",
"\nUnix: "+ date,
"\nDistance from now: "+ dateFns.distanceInWordsToNow(date),
"\nFormatted: " + dateFns.format(date),
"\nDate from now: "+ dateFns.format(new Date() - date))
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.28.5/date_fns.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.js"></script>