mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add ISO8601 date/time format to setup
Zulu time and one with microseconds, useful for timestamping Add TZ
This commit is contained in:
parent
bd9c64e014
commit
00bd581945
1 changed files with 3 additions and 0 deletions
|
@ -307,6 +307,9 @@ class Facts(object):
|
|||
self.facts['date_time']['epoch'] = now.strftime('%s')
|
||||
self.facts['date_time']['date'] = now.strftime('%Y-%m-%d')
|
||||
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']['tz'] = time.strftime("%Z")
|
||||
|
||||
|
||||
# User
|
||||
|
|
Loading…
Reference in a new issue