Skip to content

Commit

Permalink
Merge pull request ansible#11494 from jonhadfield/add_iso8601_basic_d…
Browse files Browse the repository at this point in the history
…atetime

Add facts for datetime 8601 basic and basic short.
  • Loading branch information
bcoca committed Jul 5, 2015
2 parents 05be301 + 82e00b1 commit 2a0cc38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ansible/module_utils/facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@ def get_date_time_facts(self):
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")

Expand Down

0 comments on commit 2a0cc38

Please sign in to comment.