Storages API modified_time() and timezones.

Showing 1-1 of 1 messages
Storages API modified_time() and timezones. Ian Lewis 10/18/13 9:43 PM
Hi,

I'm trying to get a handle on the modified_time() method in the Storages API. I couldn't find any hints in the doc as to what the right way to implement the modified_time() method was in regard to timezones. Currently it looks like the default FileSystemStorage backend returns the modified time as returned from os.path.getmtime() which is in the system timezone. 

Should the modified time as returned by modified_time() be in the system timezone (this is not the TIME_ZONE setting)? i.e. the FileSystemStorage is the de-facto standard?

The reason I ask this is because it raises an issue when using other different backends together since the collectstatic command will compare modified times of files from the different backends to determine if it needs to update the file. We have problems with this because some systems like AWS's S3 will return the modified time in UTC or some other timezone and need to be converted.

--
Ian

http://www.ianlewis.org/