Hi, sorry to bring this up again, but I am currently facing same issue here: following the tutorial (first time with both Django and Python). I live in Buenos Aires, Argentina (UTC-3). Therefore, I would like to set the time zone for this region. I apologize, but although I serfed the web trying to find the answer, since I am not familiar with UTC codings, I still do not understand which code should I use at the TIME_ZONE parameter. Can you please help me with it? Which of the following values should I use in the parameter?: 1) TIME_ZONE = 'UTC-3' 2) TIME_ZONE = 'UTC-03:00' 3) TIME_ZONE = 'America/Argentina' 4) TIME_ZONE = 'AR'
Many thanks in advance!! On Thursday, July 3, 2014 at 8:02:13 PM UTC-3, Mike Dewhirst wrote: > > On 3/07/2014 11:57 PM, Jerry Wu wrote: > > Mike, > > > > Sorry for the late reply. > > > > Your explanation about "time is constant" makes sense to me. But I still > > didn't know what to do with time setting following the tutorial. > > One day I'll do some experiments and *really* understand how it works. > > My variables are: > > TIME_ZONE = 'Australia/Melbourne' > > - time stored in the database eg., "2014-06-30 22:46:29.037+10" which in > June is AEST - Australian Eastern Standard Time or in March "2014-03-05 > 13:48:15.164+11" is daylight saving time. > > - USE_TZ = True > > When I find the courage I will try setting TIME_ZONE = 'UTC' and see how > times are displayed. New ones and existing ones! Maybe I'll do it around > the next changeover to daylight saving in Melbourne. > > Cheers > > Mike > > > > > Anyway, I chose to use Asia/Shanghai instead of fashion code. > > > > So far so good. > > > > Thank you very much. > > > > On Thursday, June 26, 2014 4:48:44 AM UTC+8, Mike Dewhirst wrote: > > > > Jerry > > > > I just figured it out and it is simple. Time is constant and all you > > need to do is decide how* you want to display it. The TIME_ZONE > > setting tells the server. > > > > An event happens at the same time everywhere in the universe (there > > may be Einsteinian exceptions to this) and you can store that time > > in the database relative to UTC. If you choose Shanghai time in > > settings then all recorded times are stored/displayed as Shanghai > > time. That is totally fair. People elsewhere just need to know the > > system is runing on "Shanghai time" > > > > I don't know why it was necessary to switch the Django default to > > UTC except that lots of people use and can think in UTC as well as > > local time. The entire aviation industry for example. There may be a > > tiny performance gain avoiding calculating a local time. > > > > The backwards compatibility thing is vital because if you have > > history in your database you can't just switch the base from UTC+8 > > to UTC without making all the stored times invalid by 8 hours. > > > > What do you think? > > > > Mike > > > > On Tuesday, June 24, 2014 10:34:03 AM UTC+12, Jerry Wu wrote: > > > > Dear every one, > > > > I am following the tutorial > > <https://docs.djangoproject.com/en/1.6/intro/tutorial01/> and > > meet with some problem with Time Zone part. Since I am in > > Shanghai, China (UTC+8) , I think it is necessary to reset the > > time part. > > > > Below is what I tried but failed with valuerror incorrect > > timezone setting: > > > > TIME_ZONE="UTC+8" > > TIME_ZONE="UTC+8:00" > > > > I have tried "Asia/Shanghai", it works, but I think it is kind > > of out-of-date style due to the description > > < > https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-TIME_ZONE> > > > in the tutorial. > > > > Could some one give me a hint? > > > > Thans in advance. > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Django users" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to django-users...@googlegroups.com <javascript:> > > <mailto:django-users+unsubscr...@googlegroups.com <javascript:>>. > > To post to this group, send email to django...@googlegroups.com > <javascript:> > > <mailto:django...@googlegroups.com <javascript:>>. > > Visit this group at http://groups.google.com/group/django-users. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/django-users/96dec3fb-1cb1-449b-99e1-8668c62105a4%40googlegroups.com > > > < > https://groups.google.com/d/msgid/django-users/96dec3fb-1cb1-449b-99e1-8668c62105a4%40googlegroups.com?utm_medium=email&utm_source=footer>. > > > > For more options, visit https://groups.google.com/d/optout. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/26deead6-fe0c-492d-befa-fad47f2e3d87%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.