time zone
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.
Solution:Jump to solution
you should always keep the server timezone in UTC as that is standard, then simply convert to the desired timezone for display purposes
22 Replies
Project ID:
N/A
N/A
Solution
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 auto_now_add=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
as mentioned, you want to keep all time stamps in UTC, as that is standard
I'm going to deploy again with the fixes
nothing comes out the same with UTC+0
what do you mean "comes out"
It's the same as before
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.
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.
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.
saw that
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.
That's why I did what you told me about UTC, but nothing.
please read the second half of the message
to convert it to the desired time zone for display purposes?
yes, you store all your timestamps in UTC and convert the timestamp to the users local time for display purposes
goes
please stop with the ping replies, we are the only two people in this thread