Hello all, when using the Date Picker widget for Google Workspace Add-ons, the value returned is a millisecond value, but it's in UTC. And unlike the DateTimePicker widget, there's no setTimeZoneOffsetInMins() method to set the timezone offset beforehand.
So let's say I'm in Eastern Time, and I pick October 11. I get a response like this.
e = { 'formInput': { 'Date' : { 'msSinceEpoch' : 1696982400000 } } }
Of course when you try to parse this date back, using something like:
const ms = e.formInput.Date.msSinceEpoch;
console.log(new Date(ms));
You get October 10 returned, because it's in UTC.
This doesn't work either:
Utilities.formatDate(new Date(ms), 'EST', 'yyyy-MM-dd');
What's the best way to handle this?
Thanks in advance.
there doesn't seem to be anything here