{"id":878,"date":"2016-09-29T03:36:10","date_gmt":"2016-09-29T03:36:10","guid":{"rendered":"http:\/\/timony.com\/mickzblog\/?p=878"},"modified":"2016-09-29T03:36:10","modified_gmt":"2016-09-29T03:36:10","slug":"django-db-utils-dataerror-invalid-value-for-parameter-timezone","status":"publish","type":"post","link":"https:\/\/timony.com\/mickzblog\/2016\/09\/29\/django-db-utils-dataerror-invalid-value-for-parameter-timezone\/","title":{"rendered":"django.db.utils.DataError: invalid value for parameter &#8220;TimeZone&#8221;"},"content":{"rendered":"<p>If your Django Apps throws this error:<\/p>\n<pre>\u00a0 \u00a0 cursor.execute(self.ops.set_time_zone_sql(), [tz])\r\n\r\ndjango.db.utils.DataError: invalid value for parameter \"TimeZone\": \"America\/New_York\"<\/pre>\n<p>The problem is that your Database and Django app are set to use different timezones.<\/p>\n<p>Search your Django settings files for this:<\/p>\n<pre>TIME_ZONE =<\/pre>\n<p>And then connect to your database and query for the timezone. In Postgres run this query:<\/p>\n<pre>show timezone;<\/pre>\n<p>The fix is to have your Database and Django app use the same time zone. The quickest fix is to set TIME_ZONE in your Django app to be the same as your Database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If your Django Apps throws this error: \u00a0 \u00a0 cursor.execute(self.ops.set_time_zone_sql(), [tz]) django.db.utils.DataError: invalid value for parameter &#8220;TimeZone&#8221;: &#8220;America\/New_York&#8221; The problem is that your Database and Django app are set to use different timezones. Search your Django settings files for this: TIME_ZONE = And then connect to your database and query for the timezone. In Postgres &hellip; <a href=\"https:\/\/timony.com\/mickzblog\/2016\/09\/29\/django-db-utils-dataerror-invalid-value-for-parameter-timezone\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">django.db.utils.DataError: invalid value for parameter &#8220;TimeZone&#8221;<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[685,665],"tags":[686,689,688,502,687],"class_list":["post-878","post","type-post","status-publish","format-standard","hentry","category-django","category-python","tag-django","tag-django-db-utils-dataerror","tag-postgres","tag-programming","tag-timezone"],"_links":{"self":[{"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts\/878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/comments?post=878"}],"version-history":[{"count":2,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts\/878\/revisions"}],"predecessor-version":[{"id":880,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts\/878\/revisions\/880"}],"wp:attachment":[{"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/media?parent=878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/categories?post=878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/tags?post=878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}