]> zdv2.bktei.com Git - BK-2020-03.git/blobdiff - user/bkdate
feature(user) Add legacy user scripts
[BK-2020-03.git] / user / bkdate
diff --git a/user/bkdate b/user/bkdate
new file mode 100755 (executable)
index 0000000..1bf808b
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Date: 2020-02-06T22:51Z
+
+# Description: A simple command line tool to dispay the date in ISO-8601 format.
+
+DATE="$(date --iso-8601=seconds)"
+
+if [[ $DATE =~ "+00:00"$ ]]; then
+    DATE2=${DATE::-6}"Z"
+    echo $DATE2
+    exit 0
+else
+    echo $DATE
+    exit 0
+fi