Questions tagged [django-timezone]

Timezone handling specific questions with Django

Saving, displaying time is complicated when there are multiple timezones involved. In version 1.4 django web-framework has provided a way to handle them better.

This tag helps to consolidate questions related to use of Django timezone handling.

Here is detail documentation : Time zones

179 questions
0
votes
2 answers

Django timezone confusion

The timezone for my users is fixed to PST. I can't make timezone.now() output the correct time. In settings.py I have the timezone set to US/Pacific and USE_TZ=False. Am I doing something wrong? The timezone.now() is 9 hours ahead. Also, if I want…
Andrei Ivanov
  • 651
  • 1
  • 9
  • 23
0
votes
1 answer

python django and datetime aware objects

I have a django model that some model.DateTimeFields as properties. Because the user had to be able to seperatelly add time and date, and because I wanted to be able to fully customize the date and time inputs that render in the template I did the…
Apostolos
  • 7,763
  • 17
  • 80
  • 150
0
votes
1 answer

wrong time shown in admin for registration in Django?

I just registered for a new user account using Django Admin but it gives the time of registration wrong. It must be March 24, 2014, 11.01 a.m.but it shows as March 24, 2014, 6:01 p.m. I am in PST time-zone. In my settings.py, I have TIME_ZONE =…
eagertoLearn
  • 9,772
  • 23
  • 80
  • 122
0
votes
1 answer

Multi Timezone aware app with working hours

I am working on a mobile app which for the server side uses django and angularJS + phonegap on the client side. My app relates to calendar based activities. So it is very timezone aware. The problem I am facing now is that I have a feature which I…
Nuno_147
  • 2,817
  • 5
  • 23
  • 36
0
votes
1 answer

Django convert all dates in a recordset to timezone aware

I have a django model that uses mysql as a db, and I am using timezone support. I have a field in my model that has a date. Since mysql cannot store timezone info inside the datefield, I store the timezone offset in a another field. When I query the…
Meir
  • 1,943
  • 5
  • 22
  • 38
0
votes
1 answer

Django: DateTimeQuery object has no attribute tzinfo when USE_TZ is True

I am using postgres as my database. I have a model called Invoice with a datetime field. I get an error when I run the query: Invoice.objects.datetimes('date_field','day') The error is: AttributeError: 'DateTimeQuery' object has no attribute…
zaphod100.10
  • 3,331
  • 24
  • 38
0
votes
1 answer

datetime fields are saved with different values and show different values in forms django

I have a model that has a DateTimeField in it. class Event(models.Model): ..... date = models.DateTimeField() and a model form for this event class EventForm(ModelForm): class Meta: model= Event When I create an event from…
Apostolos
  • 7,763
  • 17
  • 80
  • 150
0
votes
2 answers

How to get the local timezone of the system from Django?

I am entering the time from a local machine at a timezone +5:30. My TIME_ZONE is set to UTC in the settings.py file. Now the user entering the data from the django admin is entering it in his own local time zone which could be anywhere in the world.…
Indradhanush Gupta
  • 4,067
  • 10
  • 44
  • 60
0
votes
1 answer

datetime with timezone field/template output strange behavior

Timezone settings settings.py: USE_TZ = True TIME_ZONE = 'Europe/Moscow' # +4 Record in database table(postgresql 9.1, timestamp with timezone : 2012-12-19 15:30:51.164368+04 Django date filter: date(object.date,"d.m.Y H:i:s"), And after all…
0
votes
1 answer

strange timestamp and timedelta formats - how to convert them?

I am using external api which returns dates (as strings) in a strange format: 2012-09-26T15:44:10.376000 #timestamp 0:00:01.714000 #delta (some time duration) I want to convert them to this format: 19 Sep 2012 17:02 0:17:34 Is there easy way to do…
user606521
  • 14,486
  • 30
  • 113
  • 204
-1
votes
1 answer

How to set Time zone to TIME_ZONE = "Asia/Karachi" in Django Project?

I want to change the timezone of my django project to Asia/Karachi. I have added this in my settings.py file: TIME_ZONE = "Asia/Karachi" Time zone of my postgres is also set to Asia/Karachi. But still when I create the objects, the time zone of…
-1
votes
1 answer

Django - UTC to Local Time Conversion fails

i want to convert my UTC time to my local time my settings.py TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True my models.py class UnauthorizedAccess(models.Model): UnauthorizedAccessId = models.AutoField(primary_key=True,…
Eleena
  • 89
  • 1
  • 9
-1
votes
1 answer

What is the meaning of this function in django

def was_published_recently(self): return self.pub_date >= timezone.now() - datetime.timedelta(days=1) In a django project i used this function but i do not know why i used this
swatty
  • 1
1 2 3
11
12