Skip to content

Instantly share code, notes, and snippets.

@icarrr
Created November 1, 2019 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icarrr/5ce33237902fd1461ee23b145586e310 to your computer and use it in GitHub Desktop.
Save icarrr/5ce33237902fd1461ee23b145586e310 to your computer and use it in GitHub Desktop.
Get Time by timezone and set to variable ansible
---
- hosts: localhost
tasks:
- name: Get Time by timezone
shell: TZ=Asia/Jakarta date '+%Y-%m-%d %H:%M:%S'
register: timeByTimezone
- debug:
msg: "{{timeByTimezone}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment