Azi
12/21/2020, 9:43 PMnew Date()
.
It is a small script and I don't want to be busy importing moment.js, but I am concerned about server timezone issues may set it at the wrong date.
What is the largest range of hours off that new Date()
might be from my local timezone?battk
12/21/2020, 9:46 PMbattk
12/21/2020, 9:46 PMSandii
12/21/2020, 9:46 PMbattk
12/21/2020, 9:47 PMbattk
12/21/2020, 9:47 PMAzi
12/21/2020, 9:47 PMbattk
12/21/2020, 9:48 PMbattk
12/21/2020, 9:49 PMbattk
12/21/2020, 9:50 PMSandii
12/21/2020, 9:53 PMmichoel
12/21/2020, 10:04 PMcreece
12/21/2020, 10:19 PMfunction getTodayInCurrentUserTimezone() {
return format.parse({type: format.Type.DATE, value: format.format({type: format.Type.DATETIME, value: new Date()})});
}
This will get you a date object in the current user's timezone. You gotta use N/format module.Azi
12/21/2020, 10:53 PMAzi
12/21/2020, 10:54 PMAzi
12/21/2020, 10:57 PMZoran Roncevic
12/22/2020, 6:46 AM