1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #6656 from Jmainguy/setup

Added ansible_date_time.weekday as a fact. This returns Monday,Tuesday,W...
This commit is contained in:
Michael DeHaan 2014-03-25 13:32:57 -04:00
commit 3eecc039b9

View file

@ -416,6 +416,7 @@ class Facts(object):
now = datetime.datetime.now() now = datetime.datetime.now()
self.facts['date_time']['year'] = now.strftime('%Y') self.facts['date_time']['year'] = now.strftime('%Y')
self.facts['date_time']['month'] = now.strftime('%m') self.facts['date_time']['month'] = now.strftime('%m')
self.facts['date_time']['weekday'] = now.strftime('%A')
self.facts['date_time']['day'] = now.strftime('%d') self.facts['date_time']['day'] = now.strftime('%d')
self.facts['date_time']['hour'] = now.strftime('%H') self.facts['date_time']['hour'] = now.strftime('%H')
self.facts['date_time']['minute'] = now.strftime('%M') self.facts['date_time']['minute'] = now.strftime('%M')