django-timezone Questions
4
I'm trying to get my Django app work with the current user's time zone but I'm not getting any results...
In my settings.py file I set:
TIME_ZONE = 'UTC'
And in my views.py, I set at the top of th...
Splitlevel asked 7/12, 2020 at 11:23
7
Solved
How well does Django handle the case of different timezones for each user? Ideally I would like to run the server in the UTC timezone (eg, in settings.py set TIME_ZONE="UTC") so all datet...
Hudgins asked 30/6, 2009 at 5:45
7
Solved
I would like to know if there is a way to automatically retrieve user's timezone from client. Especially during login.
I tried to add this in the login page (using auth.login):
{% get_current_timez...
Alber asked 19/4, 2012 at 20:9
3
Solved
This issue has been occurring on and off for a few weeks now, and it's unlike any that has come up with my project.
Two of the models that are used have a timestamp field, which is by default set...
Ultimatum asked 5/11, 2012 at 4:23
1
Solved
Up to now I thought both ways to create a timezone aware datetime are equal.
But they are not:
import datetime
from django.utils.timezone import make_aware, get_current_timezone
make_aware(dateti...
Cosby asked 6/4, 2022 at 14:40
2
Timezones are driving me crazy. Every time I think I've got it figured out, somebody changes the clocks and I get a dozen errors. I think I've finally got to the point where I'm storing the right v...
Ataghan asked 9/4, 2019 at 16:46
1
Solved
Intro: My project TIME_ZONE is equal to 'UTC' while I have users from too many time zones. So, when I user make POST or PUT with date or time or dateTime fields I convert these fields to UTC befor...
Surmise asked 17/7, 2021 at 6:56
4
Solved
My server is located in London.
In my settings.py I have:
TIME_ZONE = 'Europe/Moscow'
USE_TZ = True
But when I execute this:
from django.utils import timezone
print timezone.now().hour
the code ...
Shown asked 16/4, 2013 at 12:25
3
Solved
I am following the Django official documentation for writing my first app using Django.
Here, it says that I have to set TIME_ZONE to my time zone in the settings.py file.
The default value of T...
Zigmund asked 28/11, 2014 at 5:39
4
Solved
In one of my model I am storing time_stamp = models.DateTimeField(default=timezone.now)
But when I save the model it says You are 5.5 hours ahead of server time.
for example local time in my machi...
Tallent asked 29/12, 2018 at 7:40
2
Solved
I have a button that should appear 1 day before the model object's start_date. In my view I have a functions that tells me if the object's start_date or end_date is now.
def has_engagement(self):...
Excelsior asked 2/4, 2018 at 9:19
3
Solved
I'm using Django 2.2
In my application, timezone support is enabled by USE_TZ=True in the settings file.
I have models with DateTime field created.
I need to filter data based on the date. The d...
Coniology asked 6/3, 2020 at 10:15
3
Solved
When should I be using django's timezone.now() and when should I be using python's datetime.datetime.now().
For example, in the following INSERT which would make more sense?
- Product.objects.cre...
Teach asked 15/11, 2014 at 19:45
2
Solved
In Django tutorials, there is a sentence described like below.
TIME_ZONE
...
When USE_TZ is False, this is the time zone in which Django will store
all datetimes. When USE_TZ is True, ...
Horrified asked 14/7, 2016 at 3:40
2
I have a DateField in a Django 1.8 model, something like:
from django.db import models
birth_date = models.DateField()
When it goes onto a form, I get back a 'naive' object:
birth_date = the_fo...
Cymbal asked 8/6, 2015 at 1:10
3
I have model with DateTimeField column.
I'm try to insert row with database current_time value directly into table by sql query.
My sql query for MySQL database like:
INSERT INTO MyTable (..., m...
Beckmann asked 10/1, 2014 at 7:57
1
Solved
I am creating a DataTimeField no time zone. Soon I am editing this TZ "manually" and then asking to read the value with local TZ. See the end result amends six minutes!
Logic:
>>> import...
Alburnum asked 28/9, 2016 at 23:16
1
Solved
I saw this post Is Django corrupting timezone-aware DateTimeField when saving it to the Database? but it specifically uses pytz and mysql and what not where I don't use pytz and use SQLite (incase ...
Emileeemili asked 29/1, 2016 at 12:5
3
Solved
Default value of DateTimeField for South migration in Django project with activated timezone support
I'm creating a schema migration with South 0.7.6 for my Django 1.4.3 project with enabled timezone support.
The schema migration includes adding a DateTimeField (with auto_now=True) on one table.
...
Underneath asked 16/1, 2013 at 15:54
1
I am making an events app in django.
In that I need to make a copy of one event object (row/entry in DB) into another. It creates another object with same details.
This event object involves time...
Ecdysiast asked 10/11, 2014 at 12:36
3
Solved
I want to run this function everyday midnight to check expiry_date_notification. what can I do? I'm new to django and python.
def check_expiry_date(request):
products = Product.objects.all()
for...
Geld asked 9/5, 2014 at 11:52
1
How to format DateTimeField in Admin according to localtime and timezone ?
My settings.py:
TIME_ZONE = 'Europe/Bratislava'
LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N = True
USE_TZ = T...
Demijohn asked 20/11, 2012 at 9:33
2
Solved
I have aware datetime instances (where tzinfo = "America/Los_Angeles") that I would like to save to a model.
Should I convert it to UTC somehow before saving? Or can I just save it as is, since it...
Thrips asked 4/3, 2014 at 22:18
0
Im trying to create a definition for django admin list_display, but the date filter is not timezone aware. If I just have the updated_date field in list_display, the time is correct.
def get_edite...
Skylar asked 26/2, 2014 at 18:52
1
Django's timezone-aware output apparently only applies when rendering a template. Is there a way to get that same auto-conversion to the currently active timezone for responses returning CSV or JSO...
Suazo asked 18/7, 2013 at 19:14
1 Next >
© 2022 - 2025 — McMap. All rights reserved.