Fix datetime import and module access

Change-Id: Ia8600b660f25b47318fcdf8eb8b752568475288d
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tools/ct_metrics/gen_csv_results.py b/tools/ct_metrics/gen_csv_results.py
index a2dbc77..62206b4 100755
--- a/tools/ct_metrics/gen_csv_results.py
+++ b/tools/ct_metrics/gen_csv_results.py
@@ -13,7 +13,7 @@
 import robot.errors
 import re
 import stat
-from datetime import datetime
+import datetime
 from robot.api import ExecutionResult
 from robot.result.visitor import ResultVisitor
 from xml.etree import ElementTree
@@ -235,7 +235,7 @@
 
     # Generate CSV file onto the path with current time stamp
     l_base_dir = csv_dir_path
-    l_timestamp = datetime.utcnow().strftime("%Y-%m-%d-%H-%M-%S")
+    l_timestamp = datetime.datetime.utcnow().strftime("%Y-%m-%d-%H-%M-%S")
     # Example: 2017-02-20-08-47-22_Witherspoon.csv
     l_csvfile = l_base_dir + l_timestamp + "_" + l_platform_type + ".csv"
 
@@ -288,7 +288,7 @@
     """
 
     # 20170206 05:05:19.342
-    l_str = datetime.strptime(xml_datetime, "%Y%m%d %H:%M:%S.%f")
+    l_str = datetime.datetime.strptime(xml_datetime, "%Y%m%d %H:%M:%S.%f")
     # 2017-02-06-05-05-19
     l_str = l_str.strftime("%Y-%m-%d-%H-%M-%S")
     return str(l_str)