Задать вопрос

Тел: +7 965 3737 888

502

Просмотров

0

Ответов

JSON encode ISO UTC datetime

<p>If you want to do your own JSON serialization of <a href="http://docs.python.org/library/datetime.html#datetime.datetime">datetime</a> objects instead of using DjangoJSONEncoder, use simplejson.dumps(o, default=encode_datetime). The encode_datetime method will convert the datetime object to UTC and output an ISO format string just like the <a href="http://foothold.ru/knowledge/detail/isoutc-template-filter.html">isoutc template filter</a>.</p>

Вопрос полезен? Да0/Нет0
file_3916.py(235.0б)
None