diff --git a/gym/models.py b/gym/models.py index 091ab9c..e073a9e 100644 --- a/gym/models.py +++ b/gym/models.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.db import models @@ -125,7 +126,12 @@ class Session(models.Model): notes = models.TextField('notes', blank=True) def __str__(self): - return f'{self.room} {self.start:%d/%m/%Y %H:%M}' + import pytz + print(self.start) + server_timezone = pytz.timezone(settings.TIME_ZONE) + server = server_timezone.normalize(self.start.astimezone(server_timezone)) + print(server) + return f'{self.room} {server:%d/%m/%Y %H:%M} ({settings.TIME_ZONE})' class Round(models.Model):