asfernandes / node-firebird-drivers

Node.js Firebird Drivers
MIT License
54 stars 17 forks source link

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

Open hawajrambo opened 10 months ago

hawajrambo commented 10 months ago

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 ++++; }