From 7d3eb1140705a1be4343a2fa27318e05e6d4b64a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 28 May 2019 09:47:18 -0400 Subject: [PATCH] Add month/day/year to parse Some fields come with this format timestamp rather than ISO format. Change-Id: I9e361a97f4ba42da6b0aab0ac4d9ae126a58c255 --- pyghmi/util/parse.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyghmi/util/parse.py b/pyghmi/util/parse.py index 3d476f67..eeed100a 100644 --- a/pyghmi/util/parse.py +++ b/pyghmi/util/parse.py @@ -56,4 +56,8 @@ def parse_time(timeval): return datetime.strptime(timeval, '%Y-%m-%d') except ValueError: pass + try: + return datetime.strptime(timeval, '%m/%d/%Y') + except ValueError: + pass return None \ No newline at end of file