A little bit thinking loudly here... If the scrip...
# suitescript
m
A little bit thinking loudly here... If the scripts depend on the preferences of the owner in things like the date format... and
new Date
for example would fail if you passed DD/MM/YYYY... shouldn't we always fetch the configurations and check the date format first?
b
the Date constructor functions the same way, the date format in the account doesnt change the Date's it creates
if you are trying to parse a string from netsuite into a Date, you want to use N/format, since it takes into account the formatting used by the current user
if for some reason you are trying to format a Date into a string in netsuite's format (for example in an ill advised attempt to use setText), again the answer is to use N/format to format the date into a matching string
m
if you are trying to parse a string from netsuite into a Date, you want to use N/format
Got it 🙌
Thanks
c
You can also achieve it like this: new Date(Date.parse(dateString));
m
@Core