My database in Railway change my data
Hi! I have a project working in Railway with the backend and Database in MySQL, the problem it's... My program sends to the database a date, but it date when is creates in the database MySQL of Railway, is the last day. For example, today is 2024/05/13, well if I create a data in the database, my database save the data like 2024/05/12.
I thought than was a problem of FrontEnd, but no, because when I make a SELECT in the database from DBeaver, it shows me with the date of today.
Please if there is a person than knows like fix this, thanks!!
Solution:Jump to solution
Railway's databases follow best practice, which is to save any timestamps in the UTC time zone
13 Replies
Project ID:
N/A
N/A
I would not recommend you use the data tab for anything other than a "yeah there's some data here" check, it's full of bugs that are more dangerous to your data than an incorrect date
Excuse me, I don´t understand, can you be more clear please?
I'm sorry but I don't know what I could say to clarify further
Solution
Railway's databases follow best practice, which is to save any timestamps in the UTC time zone
As Brody said, the data tab is not reliable. If you want to view your data, please continue using dbeaver
Ahhh, now I understand... Thank you so much, and yes, it's probably than the data tab has bugs, but in my program when I read a register of my table, I get the date with the date of the previous day.
For example, this is my program, and this bill is of today, but I get from database of Railway than the bill is of yesterday. When that is false.
as Adam said, the date is stored in UTC which is standard practise, your app should handle converting that UTC timestamp to the users desired time zone
So I understand for it in DBeaver my database show the correct data and date but the problem it's in the front, when I get the data.
I will search what method I use to do the converting, thanks!!
@Brody You were rigth, my problem was UTC, I made the changes and now my program work perfect, thanks!!
that was my suggestion :(
hey I did give you credit :kekw: