Commits

Tobias McNulty committed 5b310d0

S3BotoStorage.modified_time should return time in settings.TIME_ZONE, not OS timezone

  • Participants
  • Parent commits 52f5f46
  • Branches s3boto-timezone

Comments (0)

Files changed (1)

storages/backends/s3boto.py

         if last_modified_date.tzinfo == None:
             last_modified_date = last_modified_date.replace(tzinfo=tz.tzutc())
         # convert date to local time w/o timezone
-        return last_modified_date.astimezone(tz.tzlocal()).replace(tzinfo=None)
+        timezone = tz.gettz(settings.TIME_ZONE)
+        return last_modified_date.astimezone(timezone).replace(tzinfo=None)
 
     def url(self, name):
         name = self._normalize_name(self._clean_name(name))