From 4c209644751daec9b0ca262546075949a44bd7be Mon Sep 17 00:00:00 2001 From: Gerben Geijteman Date: Thu, 24 Sep 2015 15:05:44 +0200 Subject: [PATCH] Add Weekday (0-6) as a number and add weeknumber (00-52) --- 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 3d479c68c37..609e13ac597 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -622,6 +622,8 @@ class Facts(object): self.facts['date_time']['year'] = now.strftime('%Y') self.facts['date_time']['month'] = now.strftime('%m') self.facts['date_time']['weekday'] = now.strftime('%A') + self.facts['date_time']['weekday_number'] = now.strftime('%w') + self.facts['date_time']['weeknumber'] = now.strftime('%W') self.facts['date_time']['day'] = now.strftime('%d') self.facts['date_time']['hour'] = now.strftime('%H') self.facts['date_time']['minute'] = now.strftime('%M')