summaryrefslogtreecommitdiff
path: root/rfc822date.py
diff options
context:
space:
mode:
author= <pux@pux.dom>2023-01-07 14:15:09 +0100
committer= <pux@pux.dom>2023-01-07 14:15:09 +0100
commit16253d250ccf377b70b12d9430e4dcbaddded59e (patch)
tree426927c1fa22cdec3aa8d5f62acc34dd50f45204 /rfc822date.py
parent61c744e104acea884a5cb6993405af6f685949bc (diff)
downloadpub-docs-16253d250ccf377b70b12d9430e4dcbaddded59e.tar.gz
pub-docs-16253d250ccf377b70b12d9430e4dcbaddded59e.tar.bz2
pub-docs-16253d250ccf377b70b12d9430e4dcbaddded59e.zip
add rfc822 pubDate
Diffstat (limited to 'rfc822date.py')
-rwxr-xr-xrfc822date.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/rfc822date.py b/rfc822date.py
new file mode 100755
index 0000000..8ea9446
--- /dev/null
+++ b/rfc822date.py
@@ -0,0 +1,27 @@
+#!/bin/env python3
+
+from datetime import datetime
+import sys
+
+def help():
+ print(sys.argv[0] + " YYYY-MM-DD-HHMMSS [+XXXX]")
+
+# test
+#indate = "2022-12-22-182343"
+
+timezone = "+0000"
+
+if len(sys.argv) <= 1:
+ print("error no arg")
+ help()
+ sys.exit()
+if len(sys.argv) == 3:
+ timezone = sys.argv[2]
+if len(sys.argv) > 3:
+ print("error > 2 args")
+ help()
+ sys.exit()
+
+indate = sys.argv[1]
+d = datetime.strptime(indate, "%Y-%m-%d-%H%M%S")
+print(d.strftime("%a, %d %b %Y %H:%M:%S") + " " + timezone)
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa