Add qubes.storage.isodate() helper function

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-07-12 18:57:04 +02:00
parent 7841e3f6c0
commit 1bccb146d8
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -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")