phanpy icon indicating copy to clipboard operation
phanpy copied to clipboard

Date parsing issue

Open timbray opened this issue 1 year ago • 5 comments

image

[Check the date]

The URL is https://phanpy.social/#/cosocial.ca/s/112847413300864170 but when I focus in on that the date is correct.

timbray avatar Jul 25 '24 15:07 timbray

@timbray I can't seem to see the date on my side. Tried loading it on my current instance (mastodon.social), your instance (cosocial.ca) and even the author's instance (toad.social).

Probably will need more details for this.

cheeaun avatar Jul 26 '24 03:07 cheeaun

@cheeaun it went away. I saw it when @timbray opened the issue, and tried to figure out what was happening. I failed. But now it renders fine.

Fastidious avatar Jul 26 '24 15:07 Fastidious

I used to think software was deterministic, but now I know better…

timbray avatar Jul 26 '24 16:07 timbray

Random findings, trying to reverse-engineer the epoch timestamp from the date, with this console output from the browser:

> new Date(1721908512000000)
< Thu Feb 10 56535 00:00:00 GMT+0800 (Singapore Standard Time)
> new Date(1721908512000)
< Thu Jul 25 2024 19:55:12 GMT+0800 (Singapore Standard Time)

So multiplying the timestamp by 1000, it's possible to get year 56535. But the API should return ISO-8601-style strings, so possibly the dayjs library used on Phanpy did some fancy (buggy?) string parsing or the server accidentally output-ed 56535-02-10TXXXXZ in the API response 🤷‍♂️

cheeaun avatar Jul 26 '24 17:07 cheeaun

@cheeaun wow, that's some nice detective work!

Fastidious avatar Jul 26 '24 18:07 Fastidious