So I just tried this:

  - name: Print warning list users
    debug:
      msg: "{{ item.uid }} / {{ item.mail }} / {{ item.pwdexp }} / {{ 
(item.pwdexp[0:8]|to_datetime('%Y%m%d')).strftime('%m/%d/%Y')|int + 90 * 24 
* 60 * 60 }}"
    loop: "{{ warning_users }}"

And it gives me this:

"msg": "test.user1 / [email protected] / 20210715141027Z / 7776000"

Thanks,
Harry
On Thursday, December 16, 2021 at 9:25:45 AM UTC-5 Antony Stone wrote:

> On Thursday 16 December 2021 at 15:20:46, [email protected] wrote:
>
> > I get that, but I want to show it as 10/13/2021. How do I do that???
>
> I would try strftime('%m/%d/%Y') provided you are happy with dates in the 
> first 
> 12 days of each month being highly ambiguous for an international audience.
>
>
> Antony.
>
> -- 
> "There is no reason for any individual to have a computer in their home."
>
> - Ken Olsen, President of Digital Equipment Corporation (DEC, later 
> consumed 
> by Compaq, later merged with HP)
>
> Please reply to the list;
> please *don't* CC me.
>

-- 
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/3f0fc483-d693-41bf-95da-4f264befa009n%40googlegroups.com.

Reply via email to