Closed
Description
Summary
there is no module in ansible which can be helpful to manipulate dates easily like get date 1 day age or 1 week ago.need
Issue Type
Feature Idea
Component Name
to_datetime
Additional Information
set_fact:
currentdate_: "{{ '%Y-%m-%d' | strftime(ansible_date_time.epoch) }}"
currentdate_hypen: "{{ '%Y-%m-%d' | strftime(ansible_date_time.epoch) }}"
#formatted_date: "{{ current_date | strftime('%Y-%m-%d') }}"
- name: Display the formatted date
debug:
msg: "Formatted date is {{ currentdate_ }}"
- name: get yesterdays date
ansible.builtin.shell: "date -d 'yesterday 13:00' '+%Y_%m_%d'"
register: yesterday_
Code of Conduct
- I agree to follow the Ansible Code of Conduct