0

How can we use convert_tz() function in django orm query?

I have to pass conver_tz(utc_timestamp(),'+00:00', (select tz_name from timezones where tz_id = tbl_units.tz_id)) in place of current_date current_date = datetime.datetime.now() Note: I'm fetching tz_name from timezones table in database (MySQL)

4th Jul 2022, 10:55 AM
Sagar S
Sagar S - avatar
1 Réponse
0
So you want that datr field of your module shoulder return date in your format? like `ModelName.date` should be converted date when accessed directly in any part of code or you jast want to show it on a specific page?
9th Jul 2022, 5:25 AM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar