Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Commit

Permalink
fixed timezone issue. closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
justbuchanan committed Feb 24, 2014
1 parent eb03645 commit b922f4e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@
from google.appengine.ext import ndb



class EST(datetime.tzinfo):
"""EST"""

def tzname(self, dt):
return "EST"

def utcoffset(self, dt):
return datetime.timedelta(hours=-5)

def dst(self, dt):
return datetime.timedelta(0)



JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'])
Expand Down Expand Up @@ -197,7 +212,8 @@ def get(self):
class MainHandler(MyWebHandler):

def get(self):
date = datetime.date.today()
now = datetime.datetime.now(tz = EST())
date = datetime.date(now.year, now.month, now.day)
weekday = date.weekday()

plates = {}
Expand Down

0 comments on commit b922f4e

Please sign in to comment.