Re: Timezone issue in when storing in DB

2023-08-17 Thread Fred Legace
Would it not make sense to store times in UCT then in a user profile allow the user to choose their local timezone for display? On Wednesday, August 16, 2023 at 3:15:39 AM UTC-7 Ruby wrote: > You seem to be reinventing the wheel, Django already has timezone support > when you set USE_TZ >

Re: Timezone issue in when storing in DB

2023-08-16 Thread ivan harold
I recommend you reading this https://docs.djangoproject.com/en/4.2/topics/i18n/timezones/. On Wednesday, August 16, 2023 at 12:46:53 PM UTC-5 Madhusudhan Reddy wrote: > But I am using only fast api for APIs > > On Wed, 16 Aug 2023 at 3:45 PM, Ruby wrote: > >> You seem to be reinventing the whee

Re: Timezone issue in when storing in DB

2023-08-16 Thread Madhusudhan Reddy
But I am using only fast api for APIs On Wed, 16 Aug 2023 at 3:45 PM, Ruby wrote: > You seem to be reinventing the wheel, Django already has timezone support > when you set USE_TZ > to > True, > Note that your TIME_ZONE > <

Re: Timezone issue in when storing in DB

2023-08-16 Thread Ruby
You seem to be reinventing the wheel, Django already has timezone support when you set USE_TZ to True, Note that your TIME_ZONE would be the default t

Re: Timezone issue in when storing in DB

2023-08-15 Thread Mike Dewhirst
On 16/08/2023 12:35 pm, Madhusudhan Reddy wrote: Hi All, I am trying to store the date with the timezone. for example, my servers are in Mumbai, when my servers are trying to get the time of America/Detroit. it is not able to get proper time pytz is deprecated. You should consider using zonei

Timezone issue in when storing in DB

2023-08-15 Thread Madhusudhan Reddy
Hi All, I am trying to store the date with the timezone. for example, my servers are in Mumbai, when my servers are trying to get the time of America/Detroit. it is not able to get proper time Here is the snippet and details [image: Screenshot from 2023-08-16 08-00-21.png] def get_created_at(time