From 82e00b1022c1547510b25514eb87540b93e165af Mon Sep 17 00:00:00 2001 From: Jon Hadfield Date: Sun, 5 Jul 2015 17:23:22 +0100 Subject: [PATCH] add facts for datetime 8601 basic and basic short. --- lib/ansible/module_utils/facts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index cf75114c64e..cc90c070afe 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -601,6 +601,8 @@ class Facts(object): self.facts['date_time']['time'] = now.strftime('%H:%M:%S') self.facts['date_time']['iso8601_micro'] = now.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%fZ") self.facts['date_time']['iso8601'] = now.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ") + self.facts['date_time']['iso8601_basic'] = now.strftime("%Y%m%dT%H%M%S%f") + self.facts['date_time']['iso8601_basic_short'] = now.strftime("%Y%m%dT%H%M%S") self.facts['date_time']['tz'] = time.strftime("%Z") self.facts['date_time']['tz_offset'] = time.strftime("%z")