My database in Railway change my data

diego18-18PRO

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

diego18-18PRO

a year ago

N/A


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


diego18-18PRO

a year ago

Excuse me, I don´t understand, can you be more clear please?


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


diego18-18PRO

a year ago

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.


diego18-18PRO

a year ago

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.

1239752222745690000


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


diego18-18PRO

a year ago

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.


diego18-18PRO

a year ago

I will search what method I use to do the converting, thanks!!


diego18-18PRO

a year ago

@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>


My database in Railway change my data - Railway Help Station