Comment

Comment by jbnicolai

Couldn't find any feedback form on the site, so I guess I'll post it here. Seems there's a small bug in the way the time, dispayed in the console, is calculated.

FilerCtrl uses:

  var c = new Date;
  a.date = c.toDateString() + " " + ("0" + c.getUTCHours()).slice(-2) + ":" + ("0" + c.getUTCMinutes()).slice(-2) + ":" + ("0" + c.getUTCSeconds()).slice(-2);
Which does not respect the current timezone.

I suppose it could be fixed by replacing

  c.getUTCHours()).slice(-2)
with

  (c.getUTCHours()).slice(-2) + (c.getTimezoneOffset() / 60))
Although you'd probably be better of using a library like http://momentjs.com/.
parent jbnicolai 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton