16

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 TIME_ZONE was "utc" and i have changed it to "utc+6.00".

After this edit, when I try to migrate the manage.py file:

python manage.py migrate

A value error occurred:

ValueError: Incorrect timezone setting: UTC+6.00

I am sorry, if this is a very basic question, but I couldn't figure out the solution after hours of search in Google.

N.B:

My time zone is Asia/Dhaka (+6:00)

My OS is Ubuntu 14.10

dspencer
  • 4,297
  • 4
  • 22
  • 43
ni8mr
  • 1,725
  • 3
  • 31
  • 58

3 Answers3

28

According to the documentation:

TIME_ZONE

Default: 'America/Chicago'

A string representing the time zone for this installation, or None.

Instead of utc+6.00, set the TIME_ZONE to Asia/Dhaka:

TIME_ZONE = 'Asia/Dhaka'
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • Does that mean, I have to drop the project and re-create it? Suppose, I have created cookie-cutter project with incorrect time zone, then I cannot correct it later then? – Shamsul Arefin Jun 12 '19 at 07:42
11

In simple words you need to choose your timezone from this list

Ivan Kolesnikov
  • 1,787
  • 1
  • 29
  • 45
0

Cygwin: install "tzdata" package

I'm running MobaXterm (a Cygwin flavor) and so my /usr/share/zoneinfo directory was empty.

And then Django wouldn't start properly.

I fixed this by installing the tzdata package.

That populated the zoneinfo directory nicely...

$ tree /usr/share/zoneinfo | head
/usr/share/zoneinfo
├── Africa
│   ├── Abidjan
│   ├── Accra
│   ├── Addis_Ababa
│   ├── Algiers
│   ├── Asmara
│   ├── Asmera
│   ├── Bamako
│   ├── Bangui

...and then Django started up fine.

StackzOfZtuff
  • 2,534
  • 1
  • 28
  • 25