Support Topics Documentation Slack YouTube Blog

Strange behaviour with date/time


(Jorgen Andreasson) #1

Are you looking for help?

This is a support forum for reporting issues related to Backendless services. Please note that due to our support policy we cannot provide you help with debugging your code, consulting in regards to any language or third-party library usage. For this kind of questions we recommend using more appropriate forums like Stack Overflow.

In order to suggest you a quality solution, we shall usually ask you to provide the details mentioned below first. Including them into your topic right away helps us to start investigating your issue much faster.

In case you have a suggestion or an idea, the details below are not always required, though still any additional background is welcome.

Backendless Version (3.x / 5.x, Online / Managed / Pro )

5.x

Client SDK (REST / Android / Objective-C / Swift / JS )

Backendless-osx-SDK

Application ID

2B94D636-1BB0-5B65-FFD6-F1C49E497400

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

  1. I can see the date/time as, say, 4/3/2018 00:00:00 on the server saved as DateTime
  2. When loading it into the app (macOS) using Swift and not init(), I get 3/3/2018 23:00:00
  3. E.g. loosing an hour and going to the previous day.

Actual Behavior

Please provide a description of what actually happens, working from the same starting point.

Be descriptive: “it doesn’t work” does not describe what the behavior actually is – instead, say “the request returns a 400 error with message XXX”. Copy and paste your logs, and include any URLs.

Reproducible Test Case

Please provide a simple code that could be run in a new clean app and reproduce the issue.

If the issue is more complex or requires configuration, please provide a link to a project on Github that reproduces the issue.


(Anton Govorushkin) #2

Hi, @jorgen-andreasson

If you are viewing the datetime values in console - they are displayed in your locale. Values in the database are stored in UTC, that is why the response differs from the value you see in the console.
You may want to enable dates in UTC in console to see actual values stored in database.
https://monosnap.com/file/4Gu7NLiUp8lXIzZFINDwJoF1tLhOez

Anton


(Jorgen Andreasson) #3

Thank you for the help.
They must have been stored during SummerTime.