Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: How to set EDT timezone in settings for Florida

I want to set Django timezone so that clock should remain consistent with local time in Florida, which is Eastern+Daylight Savings Time (DST). Please suggest the changes to the Django settings timezone such that it is consistent with this time zone; currently the django is set for EST (Eastern Standard Time) rather than EDT (Eastern Daylight Time). It should automatically change when we enter/leave DST.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

I am running my application in amazon ubuntu. What is the best time_zone to use for Florida local time. I am using Django 1.5.

like image 765
user3270602 Avatar asked Aug 31 '15 13:08

user3270602


People also ask

How do I set timezone in Django?

Time zone support is disabled by default. To enable it, set USE_TZ = True in your settings file. In Django 5.0, time zone support will be enabled by default. Time zone support uses zoneinfo , which is part of the Python standard library from Python 3.9.

What is UTC time offset for Florida?

Most of Florida is in the Eastern Time Zone (UTC−05:00, DST UTC−04:00).

What is the default time zone setting in Django America?

Django's timezone is set to UTC by default.


1 Answers

Correct timezone name (from tz database) for Florida is "America/New_York", simply put that into your TIME_ZONE setting instead of "America/Chicago"

like image 190
GwynBleidD Avatar answered Oct 26 '22 03:10

GwynBleidD