That doesn't work for longer periods of time: "2 days, 2:02:02.000002"
It's definitely possible to parse (right now I'm using regex in Python), 
it's just annoying to have to manually write a regex for a non-standard 
format unique to Python timedeltas

On Tuesday, August 3, 2021 at 12:47:15 PM UTC-4 Brian Coca wrote:

> I was not aware of the datetime bug (was thinking to_datetime &
> strftime), but it is still simple to do in jinja:
>
> - debug: msg='{{seconds}}'
> vars:
> d: "{{res['delta'].split(':')}}"
> seconds : "{{ d[0]|int * 3600 + d[1]|int * 60 + d[2]|float }}"
>
>
> ----------
> Brian Coca
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/3f072b4f-0331-46ee-916c-31239c77564fn%40googlegroups.com.

Reply via email to