use new datetime format

This commit is contained in:
virusdefender committed 2017-01-24 16:33:06 +08:00
1 parent 3f5f72a78d
commit e98eb5c3c1
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ class JSONField(serializers.Field):
class DateTimeTZField(serializers.DateTimeField):
def to_representation(self, value):
self.format = "%Y-%-m-%d %-H:%-M:%-S"
self.format = "%Y-%-m-%d %H:%M:%S"
value = timezone.localtime(value)
return super(DateTimeTZField, self).to_representation(value)