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

2
.gitignore vendored
View File

@ -70,3 +70,5 @@ docker-compose.yml
rsyncd.passwd
node_modules/
update.sh
ssh.sh

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)