...
On windows platforms it looks like certain time zone specifications are not parsed properly and are just silently ignored without being loaded. At this point it looks like it would be any file which contains a CTRL-Z character, which includes at least "America/Sao_Paulo".
charlie.swanson commented on Mon, 30 Mar 2020 13:35:37 +0000: roberth.godoy@yahoo.com thanks for the report! I was able to reproduce this issue and it looks like the underlying problem is with the library we use to parse these files on windows platforms. I've created an issue here to track it, and I'll update this ticket accordingly. I was able to verify that with that fix in place we were able to parse and recognize "America/Sao_Paulo". I am hopeful that we can get this resolved and backported into our stable releases, but I will keep this ticket update as that process progresses. david.storch commented on Wed, 18 Dec 2019 16:48:33 +0000: Note that the embedded time zone database was upgraded to version 2019c in SERVER-44568, which will be available in versions 3.6.17, 4.0.14, and 4.2.3. Upgrading to one of these versions should be a sufficient workaround for most Windows users. daniel.hatcher commented on Tue, 17 Dec 2019 20:43:56 +0000: Thank you for the information. I am experiencing the same error as you on my Windows machine while my local Mac is able to handle the timezone file correctly. We will keep looking into this. roberth.godoy@yahoo.com commented on Sat, 7 Dec 2019 21:11:37 +0000: Yes, the file has been unzipped. eric.sedor commented on Sat, 7 Dec 2019 21:09:40 +0000: For completeness, can you please confirm the file has been unzipped? roberth.godoy@yahoo.com commented on Sat, 7 Dec 2019 21:00:30 +0000: Hi Eric. The pointing does not work yet. The extra link file you sent in the "C:\mongodb\timezonedb" folder and the error still persists. Can you reproduce these steps on a windows 10 machine? eric.sedor commented on Fri, 6 Dec 2019 22:49:20 +0000: roberth.godoy@yahoo.com, If you are still having issues pointing at recent copy of the timezone database on Windows, can you let us know? Sincerely, Eric eric.sedor commented on Mon, 11 Nov 2019 22:41:45 +0000: roberth.godoy@yahoo.com, We've opened SERVER-44568 to update the version of the timezone databases packaged with the server. The MongoError: unrecognized time zone identifier: "America/Sao_Paulo" error makes it look like the argument to processManagement.timeZoneInfo isn't correctly pointed at a timezone database. Can you confirm that the extracted contents of https://downloads.mongodb.org/olson_tz_db/timezonedb-latest.zip are located at C:\mongodb\timezonedb? Eric roberth.godoy@yahoo.com commented on Tue, 29 Oct 2019 00:42:46 +0000: Hi @eric.sedor , thanks for the reply. What would be the way to update packages on windows? edit: created mongod.cfg processManagement: timeZoneInfo: "C:\\mongodb\\timezonedb" systemLog: destination: file path: "C:\\data\\history.log" logAppend: true storage: dbPath: "C:\\data\\db" net: bindIp: 127.0.0.1 port: 27017 started mongo mongod --config "C:\Program Files\MongoDB\Server\3.6\bin\mongod.cfg" this error is returned MongoError: unrecognized time zone identifier: "America/Sao_Paulo" eric.sedor commented on Tue, 29 Oct 2019 00:16:49 +0000: Hi roberth.godoy@yahoo.com, Can you please see https://docs.mongodb.com/manual/reference/configuration-options/#processManagement.timeZoneInfo for information about how to obtain the latest IANA timezone database? It has been updated since the release of 3.6.14. Please let us know if you still have trouble after setting up the latest timezone information. Gratefully, Eric
criar um registro na coleção useevents db.getCollection('useevents').insert({ "registeredAt" : ISODate("2019-10-27T02:00:30.627Z") }) executar um aggregate db.getCollection('useevents').aggregate([{"$group":{"_id":{ "day":{"$dayOfMonth":{"date":"$registeredAt","timezone":"America/Sao_Paulo"}}},"count":{"$sum":1}}}]) resultado esperado { "_id" : { "day" : 26 }, "count" : 1.0 } resultado obtido { "_id" : { "day" : 27 }, "count" : 1.0 } se alterarmos o aggregate executando colocando o offset manualmente, o resultado esperado é alcançado db.getCollection('useevents').aggregate([ {"$group":{"_id":{ "day":{"$dayOfMonth":{"date":"$registeredAt","timezone":"-03:00"}}},"count":{"$sum":1}}}])