2 years ago
How to configure the time zone for my project so that it is UTC-5, which is from Lima, or I have also tried America/Lima this way, but it doesn't work for me because by default it outputs UTC+0, in my location it outputs normally, the datalle is when I place it in the Railway, I have tried to place the TZ as a variable in my project in railway but it doesn't work either.
25 Replies
2 years ago
you should always keep the server timezone in UTC as that is standard, then simply convert to the desired timezone for display purposes
For example, I have a column that is autonowadd=True and that's exactly what it comes out with UTC+0, but I have another one that is a normal date default=timezone.now and that normal one does come out with my time zone.
For example, I have a column that is autonowadd=True and that's exactly what it comes out with UTC+0, but I have another one that is a normal date default=timezone.now and that normal one does come out with my time zone
2 years ago
as mentioned, you want to keep all time stamps in UTC, as that is standard
2 years ago
what do you mean "comes out"
2 years ago
I'm not seeing any issues with that screenshot, perhaps I'm missing some context
What is in red is my current time and what is in green is the response when consuming my api, in theory my same current date should appear, but tomorrow's date appears.

2 years ago
yes, the date stamp on the left is localized, the date on the right is utc, there are no issues here
If there is a problem, because when you register today's date, tomorrow's date appears.
2 years ago
you simply look at the timestamp on the left
I don't think you let me explain.
I have a reserve table and when I consume, for example, today the 14th at 11 p.m., it registers it with the date of tomorrow the 15th at 4 a.m. because there is a difference of 5 hours.
I don't think you let me explain.
I have a reserve table and when I consume, for example, today the 14th at 11 p.m., it registers it with the date of tomorrow the 15th at 4 a.m. because there is a difference of 5 hours.
2 years ago
saw that
2 years ago
not sure why you where showing me console logs, in that case please read over my first message and it does cover the correct solution.
2 years ago
please read the second half of the message
2 years ago
yes, you store all your timestamps in UTC and convert the timestamp to the users local time for display purposes
2 years ago
please stop with the ping replies, we are the only two people in this thread
a month ago
Please create option to change runtime timezone?! Can it be possible rsrsrsrs?
Status changed to Solved brody • about 2 months ago
