Mercurial > libervia-backend
changeset 2477:cae326e962c3
tool (utils): import directly parser from dateutil
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 21 Jan 2018 13:04:16 +0100 (2018-01-21) |
parents | 6607bb29ab7b |
children | e5acc83a9d51 |
files | src/tools/utils.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/tools/utils.py Fri Jan 19 17:41:10 2018 +0100 +++ b/src/tools/utils.py Sun Jan 21 13:04:16 2018 +0100 @@ -24,7 +24,7 @@ from sat.core.log import getLogger log = getLogger(__name__) import datetime -import dateutil +from dateutil import parser as dateutil_parser import calendar import time import sys @@ -89,7 +89,7 @@ @param value(unicode): date to parse, in any format supported by dateutil.parser @return (int): timestamp """ - return calendar.timegm(dateutil.parser.parse(unicode(value)).utctimetuple()) + return calendar.timegm(dateutil_parser.parse(unicode(value)).utctimetuple()) def generatePassword(vocabulary=None, size=20): """Generate a password with random characters.