mysql showing day in the past
atimmer418
PROOP

8 months ago

so i have a java LocalDate being mapped to a Date column in a MySQL table. when i log the date on the backend and from the raw SQL, i get the right date but when i view the date in the table thru railway, it shows it's one day behind. is there some sort of timezone translation that is being applied that is causing the db viewer to show one day before instead of the correct date?

$10 Bounty

7 Replies

Railway
BOT

8 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


8 months ago

Hey there! Are you using a Date column in mysql or a Datetime?


noahd

Hey there! Are you using a Date column in mysql or a Datetime?

atimmer418
PROOP

8 months ago

i am using a Date column!


atimmer418

i am using a Date column!

atimmer418
PROOP

8 months ago

oh yea and even after i retrieve the value from the table, i get the right value but viewing it thru railway shows its a day behind


atimmer418

oh yea and even after i retrieve the value from the table, i get the right value but viewing it thru railway shows its a day behind

8 months ago

So I think that's because you're inserting a time in a specific timezone (or UTC) and Railway is localizing it. If you are getting the right value its purely visual


noahd

So I think that's because you're inserting a time in a specific timezone (or UTC) and Railway is localizing it. If you are getting the right value its purely visual

atimmer418
PROOP

8 months ago

hmmm yea i do have created_at and updated_at columns that are datetime. is there a way that i can disable this visual effect tho?


atimmer418

hmmm yea i do have created\_at and updated\_at columns that are datetime. is there a way that i can disable this visual effect tho?

8 months ago

To the extent of my knowledge no.

It looks to by syncing up with your device timezone so swapping that to match the timezone of the data you are inserting could resolve that.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...