aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/util.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-12-30 16:17:48 -0500
committerJesús <heckyel@hyperbola.info>2020-12-30 16:52:26 -0500
commit1f4d7cc9586bc0fbb19936efe5dad32109dfb952 (patch)
treeec25c1c4f7fc36b2d83b332a7bdad011b84126d3 /youtube/util.py
parent056c3be3f2ab9a19d8b2c38396826aaad9d4081d (diff)
downloadyt-local-1f4d7cc9586bc0fbb19936efe5dad32109dfb952.tar.lz
yt-local-1f4d7cc9586bc0fbb19936efe5dad32109dfb952.tar.xz
yt-local-1f4d7cc9586bc0fbb19936efe5dad32109dfb952.zip
General theme: fix syntax W3C markup and add improve 'Published' date
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube/util.py')
-rw-r--r--youtube/util.py7
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