Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Timezones in 2.0
var localDate = format.format({value:new Date(), type: format.Type.DATETIMETZ, timezone: format.Timezone.AMERICA_CHICAGO})
log.debug("new date ",localDate) -> 10/1/2017 8:57:29 pm
so far so good the right date string is displayed
let's convert it to a date object as per suiteanswer https://netsuite.custhelp.com/app/answers/detail/a_id/61223
var localDateObj = format.parse({value:localDate, type: format.Type.DATETIME, timezone: format.Timezone.AMERICA_CHICAGO})
log.debug("new date 2",localDateObj) -> 2017-10-02T01:57:29.000Z
ok didnt work lets try
var localDateObj = format.parse({value:localDate, type: format.Type.DATETIMETZ, timezone: format.Timezone.AMERICA_CHICAGO})
log.debug("new date 2",localDateObj) -> 2017-10-02T01:57:29.000Z