diff options
Diffstat (limited to 'youtube/util.py')
-rw-r--r-- | youtube/util.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube/util.py b/youtube/util.py index 3d5546a..fd6ca1a 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -1,3 +1,4 @@ +from datetime import datetime import settings import socks import sockshandler @@ -607,3 +608,9 @@ def strip_non_ascii(string): ''' Returns the string without non ASCII characters''' stripped = (c for c in string if 0 < ord(c) < 127) return ''.join(stripped) + + +def time_utc_isoformat(string): + t = datetime.strptime(string, '%Y-%m-%d') + t = t.astimezone().isoformat() + return t |