Giter Club home page Giter Club logo

Comments (5)

Jtplouffe avatar Jtplouffe commented on July 18, 2024

Maybe I'm not understanding the error properly, but this seems to be working as expected.
Isar saves dates as utc epoch microseconds, and reads them as utc epoch microseconds and then converts them to local.
I'm assuming your timezone is UTC-3?

from isar.

youngNyvek avatar youngNyvek commented on July 18, 2024

Talvez eu não esteja entendendo o erro corretamente, mas parece estar funcionando conforme o esperado. Isar salva datas como microssegundos da época UTC, lê-as como microssegundos da época UTC e depois as converte para locais. Presumo que seu fuso horário seja UTC-3.

Exactly, but look at the prints. The convert to local behavior does not occur on the real device, only on the emulator

from isar.

Jtplouffe avatar Jtplouffe commented on July 18, 2024

Talvez eu não esteja entendendo o erro corretamente, mas parece estar funcionando conforme o esperado. Isar salva datas como microssegundos da época UTC, lê-as como microssegundos da época UTC e depois as converte para locais. Presumo que seu fuso horário seja UTC-3.

Exactly, but look at the prints. The convert to local behavior does not occur on the real device, only on the emulator

The value that you are passing to isar is 2024-05-01T00:00:00.000Z, which is in UTC.
Isar then returns 2024-04-30T21:00:00.000, which is the exact same value as the input, but in your local time (UTC-3).

from isar.

youngNyvek avatar youngNyvek commented on July 18, 2024

Talvez eu não esteja entendendo o erro corretamente, mas parece estar funcionando conforme o esperado. Isar salva datas como microssegundos da época UTC, lê-as como microssegundos da época UTC e depois as converte para locais. Presumo que seu fuso horário seja UTC-3.

Exactly, but look at the prints. The convert to local behavior does not occur on the real device, only on the emulator

The value that you are passing to isar is 2024-05-01T00:00:00.000Z, which is in UTC. Isar then returns 2024-04-30T21:00:00.000, which is the exact same value as the input, but in your local time (UTC-3).

I think I structured the issue wrong... See, I sent 6 screenshots, the first 3 are from my real device, where isar removes -3 hours, making it a UTC date as expected, but when trying to get the entered value, it is not converting to the local time, which would be +3 hours.

Now, the other 3 prints are from the emulator, where ISAR removes -3 hours at the time of insertion and adds +3 hours at the time of obtaining the Date. In this example, I understand that it is the correct way.

Another important detail is that both devices are UTC-3, as we can see at the time of insertion, but the results are different.

from isar.

youngNyvek avatar youngNyvek commented on July 18, 2024

I found the problem, I was saving the data with DateTime.utc... I removed that and put the conventional DateTime.

For some reason this was causing inconsistency between devices.

from isar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.