Issue with JavaScript's toLocaleString: Server Output Mismatch

I’m encountering a problem with JavaScript’s locale-based date formatting. My current code converts a UTC date to a local string, but when run on the server, the format differs from what I see on my development machine. The server displays a verbose date format, whereas the local environment shows a more concise numeric version. I need to standardize the output, ensuring that both environments yield the same date format.

const utcInstance = new Date(Date.UTC(yearInput, monthInput - 1, dayInput));
const formattedDate = utcInstance.toLocaleString();

hey, maybe try forcing the locale by doing toLocaleString(‘en-us’, {year:‘numeric’, month:‘2-digit’, day:‘2-digit’}). seems the server uses defaults. hope this helps!