I would use `regex_replace` instead -
```
- debug:
msg: '{{ iso_date |regex_replace("(\d{4})\-(\d{2})\-(\d{2})\
(\d{2}):(\d{2}):(\d{2})", "\1_\2_\3_\4_\5_\6.txt") }}'
vars:
iso_date: "2023-07-20 16:36:44"
```
On Wed, Jul 26, 2023 at 2:09 AM javed khan Siddque <
[email protected]> wrote:
> Hi All,
>
>
> I want to convert the below time to human readable format, i tried some of
> the jinza formatter but it is failing .
> Failed
> {{ iso_date|iso8601_to_time|datetimeformat('%a, %B %d') }}
> requirement 2023-07-20 16:36:44
> So i can convert this to <file_name>_2023_07_20_16_36_44 .txt
>
>
> "created": "2023-07-20T16:36:44.396234Z", "modified":
> "2023-07-20T16:37:26.400464Z",
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/db9e47cf-a72f-415f-8474-16265c7eb0ccn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/db9e47cf-a72f-415f-8474-16265c7eb0ccn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
Thanks,
Abhijeet Kasurde
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAFwWkHoHbQc4QPJSUwqRSnxct%2Bq3hkuMSZWjsnoZmhvTEoatwg%40mail.gmail.com.