Marwan
06/27/2021, 7:36 PMnew Date()
returns.
I found this answer here, I followed it, but noticed that the code at the end is a little bit weird, here it is:
var timeRecord = record.load({
id: 1,
type: 'customrecord_currenttime'
});
var timezone = config.load({type: config.Type.USER_PREFERENCES}).getValue({fieldId:"TIMEZONE"})
var currentTime = timeRecord.getValue('custrecord_currenttime_now');
var usersTime = format.format({
value: usersTime,
type: format.Type.DATETIME,
timezone: format.Timezone.timezone
});
As you can see, usersTime
is passed to .format
which is weird.
Also, shouldn't currentTime be the local time?battk
06/27/2021, 7:38 PMbattk
06/27/2021, 7:38 PMbattk
06/27/2021, 7:39 PMMarwan
06/27/2021, 7:40 PMbattk
06/27/2021, 7:40 PMbattk
06/27/2021, 7:41 PMbattk
06/27/2021, 7:41 PMformat.Timezone.timezone
is undefinedMarwan
06/27/2021, 7:41 PMMarwan
06/27/2021, 7:41 PMbattk
06/27/2021, 7:42 PMMarwan
06/27/2021, 7:43 PMbattk
06/27/2021, 7:43 PMMarwan
06/27/2021, 7:46 PM