Discussions
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
format module, timezone in format function does nothing when type equal format.Type.TIMEOFDAY
I have been developing a server side script and it appears that if your format type is format.Type.TIMEOFDAY, then the timezone value is ignored.
var currentDate = new Date(); ==> Timezone is Pacific
currentDate:= Wed Nov 22 2017 01:22:29 GMT-0800 (PST)
var bossDate = format.format({
value: currentDate,
type: format.Type.DATETIME,
timezone: format.Timezone.AMERICA_NEW_YORK
});
bossDate is correctly converted to Eastern Standard Time. bossDate:=11/22/2017 4:22:29 am
var bossTime = format.format({
value: currentDate,
type: format.Type.TIMEOFDAY,
timezone: format.Timezone.AMERICA_NEW_YORK
});
bossTime = 1:22 am which is the time in Pacific