oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
72.97k stars 2.66k forks source link

Date object parsing from a string is not handled #12467

Open ika-musuko opened 1 month ago

ika-musuko commented 1 month ago

What version of Bun is running?

1.1.18+5a0b93523

What platform is your computer?

Darwin 23.1.0 x86_64 i386

What steps can reproduce the bug?

Try to convert a date string in the following format into a Javascript Date object.

const d = new Date("Sat 2022-02-26 15:50")

What is the expected behavior?

d should be 2022-02-26T06:50:00.000Z (or from whatever the calling code's timezone is)

What do you see instead?

d is an Invalid Date

Additional information

This works as expected in nodejs, deno, and in the browser.

Jarred-Sumner commented 1 month ago

I'm not able to reproduce this

image
github-actions[bot] commented 1 month ago

Hello @ika-musuko. Please provide a minimal reproduction using a GitHub repository, Replit, or CodeSandbox. Issues marked with needs repro will be closed if they have no activity within 3 days.

ika-musuko commented 1 month ago

Interesting, I can't reproduce this on my Darwin 23.4.0 arm64 arm machine, it works totally fine.

But on my Darwin 23.1.0 x86_64 i386 machine, I still run into this issue. It's a 2019 MacBook Pro with an Intel i5 processor.

This works fine on Replit as well.

Happy to provide more specs on the machines.

(personal reference for me to check out later: https://github.com/oven-sh/bun/blob/caaeae123a2919b6298e8d0d122cc69065eaffc2/src/bun.js/ConsoleObject.zig#L2600)