In this link is possible see the wrong when click in America/Sao_paulo
https://momentjs.com/timezone/
Brazil stop using DST but , moment timezone is using DST.
Can I set the configuration for stop using DST?
+1
Hi, I am got this erro using just moment (without 'moment-timezone') so I install 'moment-timezone' and set ' moment.tz('America/Sao_Paulo')' to fix them.
https://momentjs.com/timezone/docs/#/use-it/node-js/
PS.: Is possible to set with default timezone 'moment.tz.setDefault('America/Sao_Paulo');'
Brazil no longer has DST changes - decree signed today
https://g1.globo.com/politica/noticia/2019/04/25/bolsonaro-assina-decreto-que-acaba-com-o-horario-de-verao.ghtml
From Daniel Soares de Oliveira (2019-04-26):
http://www.planalto.gov.br/ccivil_03/_Ato2019-2022/2019/Decreto/D9772.htm
In this link is possible see the wrong when click in America/Sao_paulo
https://momentjs.com/timezone/Brazil stop using DST but , moment timizone is using DST.
Can I set the configuration for stop using DST?
You can use 'moment.tz.setDefault('America/Sao_Paulo');'
+1
You can use 'moment.tz.setDefault('America/Sao_Paulo');'
mine already has this config ;(
You can use 'moment.tz.setDefault('America/Sao_Paulo');'
mine already has this config ;(
Maybe, have to use the last version.
Check the moment-timezone version, if not is last , update it.
https://github.com/moment/moment-timezone
https://www.npmjs.com/package/moment-timezone
A possible workaround is to use Bahia's timezone: moment.tz.setDefault('America/Bahia');. This timezone doesn't use DST and it is at -3 .
const moment = require('moment-timezone').tz.setDefault('America/Sao_Paulo');
//returns the right time
const moment = require('moment');
//returns with + 1h
I got the same problem. But, with Cuiab谩's timezone which is using DST. :confused:
Same problem here.
If I use new Date().getTimezoneOffset() it returns 180 in some browsers and 120 in others.
But the moment().utcOffset() aways returns -120.
A possible workaround is to use Bahia's timezone:
moment.tz.setDefault('America/Bahia');. This timezone doesn't use DST and it is at -3 .
Good workaround, but in my case, the custumer can set his timezone, now I set -1 hardcode to work in america/sao_paulo.
I'm waiting for the fix in momment plugin =D
I patched it by myself. Search for the string "America/Sao_Paulo|LMT" in the source file of moment-timezone and replace the whole row with the following:
"America/Sao_Paulo|LMT -03 -02|36.s 30 20|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2glwR.w HdKR.w 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 pTd0 PX0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|20e6",
I hope this will help.
After upgrade to moment-timezone:0.5.27 worked for us in most browsers, and I recommend upgrade the browsers too.
Can confirm that this is working in moment-timezone versions 0.5.26 and later. However, the abbreviation for the timezone is now non-functioning. See https://codesandbox.io/s/objective-pasteur-znco2 for a demo of the timezone working but the abbreviation not working.
Guys, upgrade your chrome/firefox/safari to latest version and it will works nicely 馃憤.
Guys, upgrade your chrome/firefox/safari to latest version and it will works nicely 馃憤.
I can't ask customers of my product to do this 馃槩
Please don't answer if you did not get the point.
In the current official distribution of timezone-moment-with-data.js (0.5.25-2019a, this is the link https://momentjs.com/timezone/), the timezone America/Sao_Paulo has a programmatic change to DST on November, 3th 2019 and so on for all the following years. This is not a bug that you can fix by upgrading the browser. This is a wrong information in the data caused by a missing change after this decree: https://g1.globo.com/politica/noticia/2019/04/25/bolsonaro-assina-decreto-que-acaba-com-o-horario-de-verao.ghtml.
The problem can be solved by installing a newer version of moment-timezone-with-data.js (if the developer team includes this upgrade) or by patching it by yourself following these easy steps, as already posted above:
Search for the string "America/Sao_Paulo|LMT" in the source file of moment-timezone and replace the whole row with the following:
"America/Sao_Paulo|LMT -03 -02|36.s 30 20|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2glwR.w HdKR.w 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 pTd0 PX0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|20e6".
As you can see what I am doing is using the same data as before but with dates only until last DST change. That's all.
@MassimilianoCarosi the current moment-timezone version is 0.5.27 and uses TZDB 2019c.
Look at releases page: https://github.com/moment/moment-timezone/releases

About browsers, @leonardocouy is right too, because the browsers also had the wrong timezone in old versions.
Three days ago, if I ran new Date().getCurrentTimezone() in Chrome, Firefox and Safari were returning 120 (2 hours), even though the operating system was set to -03:00.
For us, the problem has been completely eliminated after updating moment-timezone AND BROWSERS.
@MassimilianoCarosi the current
moment-timezoneversion is0.5.27and uses TZDB 2019c.Look at releases page: https://github.com/moment/moment-timezone/releases
About browsers, @leonardocouy is right too, because the browsers also had the wrong timezone in old versions.
Three days ago, if I rannew Date().getCurrentTimezone()in Chrome, Firefox and Safari were returning 120 (2 hours), even though the operating system was set to-03:00.For us, the problem has been completely eliminated after updating moment-timezone AND BROWSERS.
It worked for me! Great! 銑楋笍
In this case the https://momentjs.com/timezone/ not updated with the last realease but in git hub is up to date.
Thank you very much guys!
Most helpful comment
@MassimilianoCarosi the current
moment-timezoneversion is0.5.27and uses TZDB 2019c.Look at releases page: https://github.com/moment/moment-timezone/releases
About browsers, @leonardocouy is right too, because the browsers also had the wrong timezone in old versions.
Three days ago, if I ran
new Date().getCurrentTimezone()in Chrome, Firefox and Safari were returning 120 (2 hours), even though the operating system was set to-03:00.For us, the problem has been completely eliminated after updating moment-timezone AND BROWSERS.