From 1f4d7cc9586bc0fbb19936efe5dad32109dfb952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Wed, 30 Dec 2020 16:17:48 -0500 Subject: General theme: fix syntax W3C markup and add improve 'Published' date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jesús --- youtube/util.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'youtube/util.py') 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 -- cgit v1.2.3