# Date in a Jinja template

**URL:** <https://forum.ansible.com/t/date-in-a-jinja-template/34301>\
**Category:** Ansible Project\
**Created:** [December 8, 2020, 2:19pm UTC](https://forum.ansible.com/t/date-in-a-jinja-template/34301 "2020-12-08T14:19:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harry\_devine](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harry_devine/32/5293_2.png) [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Post date:** [December 8, 2020, 2:19pm UTC](https://forum.ansible.com/t/date-in-a-jinja-template/34301/1 "2020-12-08T14:19:44Z")

</div>

I generate a report using a Jinja template file from one of my playbooks and mail that file to several users. In it, I am putting the current date and time as follows:

Date generated: {{ now(false, ‘%m/%d/%Y %I:%M:%S’) }}

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [December 8, 2020, 2:49pm UTC](https://forum.ansible.com/t/date-in-a-jinja-template/34301/2 "2020-12-08T14:49:13Z")

</div>

I think now() is naive, i.e. it does not know about time zones.  
If you need time zones, then I'd give 'ansible\_date\_time' a try.

---

<div class="post-metadata">

**Author:** ![harry\_devine](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harry_devine/32/5293_2.png) [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Post date:** [December 8, 2020, 4:08pm UTC](https://forum.ansible.com/t/date-in-a-jinja-template/34301/3 "2020-12-08T16:08:50Z")

</div>

Thank you! That worked very well.

Harry
