in my website a user saves DateTimeField in model and I need to display this time in my template according to other user's local time. For instance, if a user in Mexico creates a new tour it should be saved in model in Mexico time but for a user in America i want it to be displayed in US time.
This is my setting.py :
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
and this is my code in views.py :
utc = pytz.utc
date_field = form.cleaned_data['date']
time_field = form.cleaned_data['time']
meeting.date_time = utc.localize(datetime.combine(date_field,time_field))
meeting.save()
and this is my template :
<p class="">{{meeting.date}} {{meeting.date_time|localtime|date:'h:i A'}}</p>
but it is not working!