I have a weird case where my datetime from the client doesn't always convert to UTC on the server.
For example i select in the client the date 03/07/2024 08:00 (Lisbon time), when i receive this attribute in the server action its changed to UTC 03/07/2024 07:00 as expected.
But... sometimes this doesn't happen and i can't understand why. Sometimes i receive the exact datetime that i selected in the client and its stored with that value in the database. Not in UTC.
I can't replicate this but i have multiple cases stored in the database where this happen, this also happen while debugging.
Note: This date is selected in the client and never changes until its saved in the DB.
Anyone else had this problem? Is this a bug?
Problem found.
Server takes into account the datetime received and converts to UTC based on that date. That's ok, but if i try to create a date in the future where the daylight saving is the same as the server it doesn't convert as expected.
This creates a problem with the following example:
Date range to create - 30/10/2024 9:00 until 30/10/2024 17:45
Date range already in the database - 30/10/2024 17:00 until 30/10/2024 19:00
Since the datetime Date range to create is already in a moment in time where Lisbon time is +0 it doesn't remove 1 hour and this creates a problem with the Date range already in the database because they intercept.
Its not an error but a detail that's needed to be taken into account.
Hi @Miguel Barata ,
Maybe just daylight savings time. Portugal is UTC + 0 for part of the year.
Dorine
Yes but all records were created last week/this week, its +1
Hi,
Here want to add one more point about this conversion :
When we save date time in the database, it will be auto convert in UTC and vice versa. But it will not happen if you are using only Date or Time, auto conversion only work for datetime.
regards
Yes, im using date time type, not date and time separated
Dear Migual,
We already have a solution/forge component for your issue
Link
Please refer the link
Update
Was able to reproduce it again and took some SS while debugging.
Note: date and time pickers are separated in the client but i do a build date time in the client action before sending to the server.
Ex1:
date time received in the input of the SA in UTC (correct)
Ex2:
date time received in the input of the SA (incorrect)