ansible.builtin.strftime (v2.16.0) — filter

date formating

| "added in version" 2.4 of ansible.builtin"

Authors: unknown

Install Ansible via pip

Install with pip install ansible-core==2.16.0

Description

Using Python's C(strftime) function, take a data formating string and a date/time to create a formated date.

Inputs

    
utc:
    default: false
    description: Whether time supplied is in UTC.
    type: bool

_input:
    description:
    - A formating string following C(stftime) conventions.
    - See L(the Python documentation, https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior)
      for a reference.
    required: true
    type: str

second:
    description: Datetime in seconds from C(epoch) to format, if not supplied C(gmttime/localtime)
      will be used.
    type: int

Outputs

_value:
  description: A formatted date/time string.
  type: str