How to change the utc to my timezone?

I am on a project springboot and my account is on a Hobby plan, account name: Garrys Rakotoarisoa. So the project is a springboot project with a postgresql database. I have a table in which one of the field in a timestamp current timestamp, so when i execute my springboot project with the deployed database, i gives the exact timestamp of my country (I've set the timezone in postgresql to "Indian/Antananarivo"), but when i test the same springboot project on the deployed one with the same database, it gives another timestamp for example now in my country it's 13:19 and the currenttimestamp when i execute with the deployed project is 10:19, what should i do? I've also tested it by setting the timezone direcly in the java project with "Indian/Antananarivo" but it's the same result.
Solution:
Localise it on your frontend
Jump to solution
13 Replies
Percy
Percy5mo ago
Project ID: N/A
Percy
Percy5mo ago
Project ID: N/A
steven_grizy7
steven_grizy75mo ago
what do you mean by project id? here it is: 331af033-1a19-4fbb-bc92-42668f8e8e7e
macwilko
macwilko5mo ago
Railway servers are configured to have time set to UTC.
steven_grizy7
steven_grizy75mo ago
so it can not be change? like just for my project?
macwilko
macwilko5mo ago
Im not sure, but generally the approach to solve this is to localise the display of time. The timestamp is correct, it’s just you need to display the time with Indian Timezone So if you have a dashboard etc, and you want to display the times recorded in the database, you simply parse the UTC date and then display it for Indian Timezone
steven_grizy7
steven_grizy75mo ago
No description
steven_grizy7
steven_grizy75mo ago
this is the database, it is already set to Indian/Antananarivo, it is where i do not understand why it follows utc even if it is already set in the database
macwilko
macwilko5mo ago
Not sure, I’d recommend removing those changes and leave it as default. Handle Timezone as a localisation problem
steven_grizy7
steven_grizy75mo ago
i've set the timezone to default now and it shows Etc/UTC, so now what should i do?
Solution
macwilko
macwilko5mo ago
Localise it on your frontend
steven_grizy7
steven_grizy75mo ago
okay thank youu do you work for railway?
macwilko
macwilko5mo ago
no