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();