Adding missing kong.common.utils module
Change-Id: I6015e6525205a1cfaaba2fc664cc1212afc2cb08
diff --git a/kong/common/utils.py b/kong/common/utils.py
new file mode 100644
index 0000000..08730b9
--- /dev/null
+++ b/kong/common/utils.py
@@ -0,0 +1,15 @@
+import datetime
+
+
+#TODO(bcwaldon): expand this to support more iso-compliant formats
+ISO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
+
+
+def load_isotime(time_str):
+ """Convert formatted time stjring to a datetime object."""
+ return datetime.datetime.strptime(time_str, ISO_TIME_FORMAT)
+
+
+def dump_isotime(datetime_obj):
+ """Format a datetime object as an iso-8601 string."""
+ return datetime_obj.strftime(ISO_TIME_FORMAT)