use new datetime format
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -69,4 +69,6 @@ docker-compose.yml
|
|||||||
*.zip
|
*.zip
|
||||||
rsyncd.passwd
|
rsyncd.passwd
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
|
update.sh
|
||||||
|
ssh.sh
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user