node-firebird-drivers icon indicating copy to clipboard operation
node-firebird-drivers copied to clipboard

BUG, all dates are behind 1 day on UTC+nn timezones (eastern region)

Open hawajrambo opened this issue 1 year ago • 0 comments

Constructing date in javascript is insane: To get the wanted date: month should be added -1, and local timezone should be substracted.

we are at UTC+01:00 now.

(new Date(2011,11,31)).toISOString()
"2011-12-30T23:00:00.000Z" 

new Date((new Date(2011,12,31)) - (new Date()).getTimezoneOffset()*1000*60).toISOString()
 "2012-01-31T00:00:00.000Z" 

fb-util should be fixed:

return new Date(decodedDate.year, decodedDate.month - 1, decodedDate.day ) ++++ OFFSET ++++; }

hawajrambo avatar Jan 10 '24 09:01 hawajrambo