From 00bd581945646b66b29cf88631c01f64628a6f88 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Fri, 1 Mar 2013 09:28:03 +0100 Subject: [PATCH] Add ISO8601 date/time format to setup Zulu time and one with microseconds, useful for timestamping Add TZ --- library/setup | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/setup b/library/setup index 8060ed5f409..85a362ffb8a 100644 --- a/library/setup +++ b/library/setup @@ -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