Open baramofme opened 1 month ago
first, timezone offset adjustment failed.
I misunderstoold.there's diferrences between my computer and google apps script location(GCP).
getTimezoneOffset
is give me differecese between UTC and GCP server timezone. Not original time's timezone.
and There's no way to convert it ..??
I'm not alone
There is no method make new Date().getTime()
spit out millisecnods with user set Timezone.
No? Doesn't matter. too many times spend. It's not good for my real life. debugging ruins my life ...
OK, I choose easy way, cheat Date() object.
input time striong aprt from timezone part.
> new Date( '2024-08-08T15:54:00.000+09:00')
2024-08-08T06:54:00.000Z
> new Date( '2024-08-08T15:54:00.000Z')
2024-08-08T15:54:00.000Z
> new Date( '2024-08-08T15:54:00.000Z').toISOString()
'2024-08-08T15:54:00.000Z'
> new Date( '2024-08-08T15:54:00.000Z').toISOString().replace( "Z", "+09:00")
'2024-08-08T15:54:00.000+09:00'
see? and working.
Fixed
first no timezone. second, during sync, add time by UTC. finally, notion display datetime as UTC.
Users can't calucate everytime. It's so confused