From 4f3a808222e124b2462da9be6407f77e2092a89e Mon Sep 17 00:00:00 2001 From: TOW Date: Sun, 7 Apr 2019 07:15:36 -0300 Subject: Usando hora local del servidor. Está bien configurado ahora. --- cgi/framework.py | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/cgi/framework.py b/cgi/framework.py index 8c43d02..9c95cc1 100644 --- a/cgi/framework.py +++ b/cgi/framework.py @@ -14,28 +14,6 @@ from Cookie import SimpleCookie from settings import Settings from database import * -class CLT(datetime.tzinfo): - """ - Clase para zona horaria chilena. - Como el gobierno nos tiene los horarios de verano para la pura cagá, - por mientras dejo el DST como un boolean. Cuando lo fijen, dejarlo automático. - """ - def __init__(self): - self.isdst = False - - def utcoffset(self, dt): - #return datetime.timedelta(hours=-3) + self.dst(dt) - return datetime.timedelta(hours=Settings.TIME_ZONE) - - def dst(self, dt): - if self.isdst: - return datetime.timedelta(hours=1) - else: - return datetime.timedelta(0) - - def tzname(self,dt): - return "GMT -3" - def setBoard(dir): """ Sets the board which the script is operating on by filling Settings._.BOARD @@ -163,9 +141,7 @@ def formatDate(t=None, home=False): Format a datetime to a readable date """ if not t: - t = datetime.datetime.now(CLT()) - # Timezone fix - #t += datetime.timedelta(hours=1) + t = datetime.datetime.now() days = {'en': ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'], 'es': ['lun', 'mar', 'mie', 'jue', 'vie', 'sab', 'dom'], @@ -199,7 +175,7 @@ def formatTimestamp(t, home=False): """ Format a timestamp to a readable date """ - return formatDate(datetime.datetime.fromtimestamp(int(t), CLT()), home) + return formatDate(datetime.datetime.fromtimestamp(int(t)), home) def timeTaken(time_start, time_finish): return str(round(time_finish - time_start, 3)) -- cgit v1.2.1-18-gbd029