spencermountain / spacetime

A lightweight javascript timezone library
http://spacetime.how/
Other
3.97k stars 185 forks source link

Default Timezone Offset wrong? #337

Closed kimonneuhoff closed 2 years ago

kimonneuhoff commented 2 years ago

Hello,

Why is the default offset of "Europe/Berlin" 2? Germany is in UTC+1 by default and only while DST UTC+2. Or am i wrong??

-> spacetime.now().timezone()

{name: 'Europe/Berlin', hasDst: true, default_offset: 2, hemisphere: 'North', current: {…}, …} change: {start: '03/27:02', back: '10/30:03'} current: {offset: 2, isDST: true} default_offset: 2 hasDst: true hemisphere: "North" name: "Europe/Berlin"

spencermountain commented 2 years ago

hey Kimon, yeah, the library assumes the current timezone of the computer, if none is supplied. This can be a gotcha, if your code is running on a server somewhere.

Berlin is currently in +2 - you can see the spacetime timezone like this cheers