use new datetime format

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

4
.gitignore vendored
View File

@ -69,4 +69,6 @@ docker-compose.yml
*.zip *.zip
rsyncd.passwd rsyncd.passwd
node_modules/ node_modules/
update.sh
ssh.sh

View File

@ -11,7 +11,7 @@ class JSONField(serializers.Field):
class DateTimeTZField(serializers.DateTimeField): class DateTimeTZField(serializers.DateTimeField):
def to_representation(self, value): 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) value = timezone.localtime(value)
return super(DateTimeTZField, self).to_representation(value) return super(DateTimeTZField, self).to_representation(value)