From 1bccb146d8b8096cb72fc82f0ed4afcc6917f767 Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Tue, 12 Jul 2016 18:57:04 +0200 Subject: [PATCH] Add qubes.storage.isodate() helper function --- qubes/storage/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qubes/storage/__init__.py b/qubes/storage/__init__.py index b573dfc9..7bb6ea6f 100644 --- a/qubes/storage/__init__.py +++ b/qubes/storage/__init__.py @@ -30,6 +30,8 @@ from __future__ import absolute_import import os import os.path import string # pylint: disable=deprecated-module +import time +from datetime import datetime import lxml.etree import pkg_resources @@ -520,3 +522,8 @@ def pool_drivers(): """ Return a list of EntryPoints names """ return [ep.name for ep in pkg_resources.iter_entry_points(STORAGE_ENTRY_POINT)] + + +def isodate(seconds=time.time()): + ''' Helper method which returns an iso date ''' + return datetime.utcfromtimestamp(seconds).isoformat("T")