diff options
author | TOW | 2019-04-07 07:15:36 -0300 |
---|---|---|
committer | TOW | 2019-04-07 07:18:22 -0300 |
commit | 4f3a808222e124b2462da9be6407f77e2092a89e (patch) | |
tree | 47fcde8f71ae9a9d683ba0351158f382b1e514c3 /cgi | |
parent | 905d58aa50ae33d76a7eaf8624a5e29d25d6d382 (diff) | |
download | weabot-4f3a808222e124b2462da9be6407f77e2092a89e.tar.gz weabot-4f3a808222e124b2462da9be6407f77e2092a89e.tar.xz weabot-4f3a808222e124b2462da9be6407f77e2092a89e.zip |
Usando hora local del servidor.
Está bien configurado ahora.
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/framework.py | 28 |
1 files 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)) |