Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Invalid Date Format error in server side script
HI There
I am receiving an invalid date format error on a Suitelet on the Post part of the script:
I had assumed that maybe the formattedDate variable was returning a string instead of a date value so tried to use format.parse. However, this returns both date and time
var currentDate = new Date();
var formattedDate = format.format({
value: currentDate,
type: format.Type.DATE,
timezone:format.Timezone.PACIFIC_AUCKLAND
});
log.debug("formattedDate", formattedDate);
var parsedDate= format.parse({
value: "18/04/2024",
type: format.Type.DATE
});
log.debug("parsedDate",parsedDate)
Why is the parseDate variable returning date/time instead of just date?
The user and company preferences are both for date to be displayed as "DD/MM/YYYY"
Tagged:
0