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

Тел: +7 965 3737 888

432

Просмотров

0

Ответов

isoutc template filter

<p>Use this template filter to produce an ISO format UTC datetime string from a <a href="http://docs.python.org/library/datetime.html#datetime.tzinfo">timezone aware</a> <a href="http://docs.python.org/library/datetime.html#datetime.datetime">datetime</a> object. Usage example in a template:
&lt;input name="when" type="hidden" value="{{ dt|isoutc }}".
You must have <a href="http://labix.org/python-dateutil">dateutil</a> installed for tz.tzutc() to work. And of course, you'll need to load it as a <a href="http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags">custom tag</a> to use it.</p>
<p>The output format differs from python's <a href="http://docs.python.org/library/datetime.html#datetime.datetime.isoformat">datetime.isoformat</a> by ignoring the microsecond and including a "Z" suffix for the UTC timezone. For ease of use, it is also not double quoted as the standard suggests.</p>

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