why inside NetSuite client script does the followi...
# suitescript
s
why inside NetSuite client script does the following code return this 2023-05-30 but inside node/browser 05-30-2023
Copy code
const today_date = new Date().toLocaleDateString("en-US");
d
I faced same issue some time ago. Can you play with user preferences for dates format and see if this affect the code on client-script
m
If it's a client script you should get the same results as the browser
s
well chat gpt gave a good idea
Copy code
var todayDate = new Date();
var formattedDate = format.format({
    value: todayDate,
    type: format.Type.DATE,
    format: "MM/dd/yyyy"
});