a year ago
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!!
0 Replies
a year ago
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
a year ago
I'm sorry but I don't know what I could say to clarify further
a year ago
Railway's databases follow best practice, which is to save any timestamps in the UTC time zone
a year ago
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.
a year ago
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.
@Brody You were rigth, my problem was UTC, I made the changes and now my program work perfect, thanks!!
a year ago
that was my suggestion :(
a year ago
hey I did give you credit <:kekw:788259314607325204>