Hi Brendan!
Happy new year!
I’m not sure, if this is a bug of it I’m stupid…
> I have a date field.
> I want to use the date in a script.
> Finally I need the date in YYYY-MM-DD Format
For this I like to use the ISO-Format.
.”getFieldValue” returns:
Sun Apr 19 2020 00:00:00 GMT+0200 (CEST)
If I now use “.toISOString” I get:
2020-04-18T22:00:00.000Z
As you see, the date is changing to one day before, because the time zone is ignored.
As a workaround I use
“date.toLocaleDateString(‘ja-JP’, {year: ‘numeric’,month: ‘2-digit’,day: ‘2-digit’}).replace(/\//g, ‘-‘)”
But this seems not to be the most elegant way. Any other ideas?
Regards, Eddy