# adding time with ISO8601 format

**URL:** <https://forum.ansible.com/t/adding-time-with-iso8601-format/29379>\
**Category:** Ansible Project\
**Created:** [January 5, 2019, 9:28pm UTC](https://forum.ansible.com/t/adding-time-with-iso8601-format/29379 "2019-01-05T21:28:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IP\_Freely](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@IP\_Freely](https://forum.ansible.com/u/IP_Freely)\
**Post date:** [January 5, 2019, 9:28pm UTC](https://forum.ansible.com/t/adding-time-with-iso8601-format/29379/1 "2019-01-05T21:28:19Z")

</div>

I’m trying to send a ISO8601 time format string to the Prometheus alert manager through the uri moule to tell it to silence an alarm for the next hour.

I have worked out that the current time is available (ansible\_date\_time.iso8601) but how can i create a fact that is current ISO8601 time add 45 minutes or 1 hour for example? for when the end of the silence should be?

Many thanks in advance (hoping this is possible)

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 5, 2019, 11:58pm UTC](https://forum.ansible.com/t/adding-time-with-iso8601-format/29379/2 "2019-01-05T23:58:42Z")

</div>

The easiest is to just use the date command

{{ lookup('pipe', 'date --iso-8601=seconds --utc --date="+45 minutes"') }}  
{{ lookup('pipe', 'date --iso-8601=seconds --utc --date="+1 hour"') }}
