time zone
Anonymous
TRIALOP

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.

Solved

25 Replies

Anonymous
TRIALOP

2 years ago

N/A


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


Anonymous
TRIALOP

2 years ago

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.


Anonymous
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago

I'm going to deploy again with the fixes


Anonymous
TRIALOP

2 years ago

nothing comes out the same with UTC+0

1229291060795281400


2 years ago

what do you mean "comes out"


Anonymous
TRIALOP

2 years ago

It's the same as before


2 years ago

I'm not seeing any issues with that screenshot, perhaps I'm missing some context


Anonymous
TRIALOP

2 years ago

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.

1229294189628620800


2 years ago

yes, the date stamp on the left is localized, the date on the right is utc, there are no issues here


Anonymous
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago

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.


Anonymous
TRIALOP

2 years ago

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.


Anonymous
TRIALOP

2 years ago

That's why I did what you told me about UTC, but nothing.


2 years ago

please read the second half of the message


Anonymous
TRIALOP

2 years ago

to convert it to the desired time zone for display purposes?


2 years ago

yes, you store all your timestamps in UTC and convert the timestamp to the users local time for display purposes


Anonymous
TRIALOP

2 years ago

goes


2 years ago

please stop with the ping replies, we are the only two people in this thread


emdc
HOBBY

a month ago

Please create option to change runtime timezone?! Can it be possible rsrsrsrs?


Status changed to Solved brody about 2 months ago


Loading...