aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-11-04 16:31:55 +0000
committerng0 <ng0@n0.is>2019-11-04 16:31:55 +0000
commitf95696d36fd084997bff907e157624b8c7f22ce9 (patch)
treec228cbd67679bb76f0ec3cc9b2e8fd7fe5060c59
parentd9c8dc5c2b94e28d6ffa945f0b235fc1a790aa19 (diff)
downloadwww-f95696d36fd084997bff907e157624b8c7f22ce9.tar.gz
www-f95696d36fd084997bff907e157624b8c7f22ce9.zip
rssg: gnu date
-rwxr-xr-xrssg14
1 files changed, 11 insertions, 3 deletions
diff --git a/rssg b/rssg
index 1a2e596b..ef860187 100755
--- a/rssg
+++ b/rssg
@@ -125,9 +125,17 @@ rel_to_abs_urls() {
125 125
126 126
127date_rfc_822() { 127date_rfc_822() {
128 if date --version >/dev/null 2>&1; then 128# perl -MPOSIX -le 'print strftime "%a, %d %b %Y %H:%M:%S %z", (localtime "$1");'
129 date '+%a, %d %b %Y %H:%M:%S %z' \ 129# x="$(echo "$1"| tr -cd '[:digit:]')0000"
130 "$(echo "$1"| tr -cd '[:digit:]')0000" 130# awk -v a="$x" '{print strftime("%a, %d %b %Y %H:%M:%S %z", x)}'
131 if date --version >/dev/null 2>&1; then
132 in="$(echo "$1"| tr -cd '[:digit:]')0000"
133 year=$(echo $in | cut -c1-4)
134 month=$(echo $in | cut -c5-6)
135 day=$(echo $in | cut -c7-8)
136 hour=$(echo $in | cut -c9-10)
137 minute=$(echo $in | cut -c11-12)
138 date '+%a, %d %b %Y %H:%M:%S %z' "$(echo "$year"-"$month"-"$day" "$hour":"$minute")"
131 else 139 else
132 date -j '+%a, %d %b %Y %H:%M:%S %z' \ 140 date -j '+%a, %d %b %Y %H:%M:%S %z' \
133 "$(echo "$1"| tr -cd '[:digit:]')0000" 141 "$(echo "$1"| tr -cd '[:digit:]')0000"