From: Steven Baltakatei Sandoval Date: Sun, 28 Jun 2020 19:48:33 +0000 (+0000) Subject: feat(unitproc):Add dateTimeShort to get short timestamp X-Git-Tag: 0.2.0~35 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/ea8ea560b8fd5d0ce500ef462eb0142c419167a5?ds=sidebyside feat(unitproc):Add dateTimeShort to get short timestamp --- diff --git a/unitproc/bktemp-dateTimeShort b/unitproc/bktemp-dateTimeShort new file mode 100644 index 0000000..d6491c1 --- /dev/null +++ b/unitproc/bktemp-dateTimeShort @@ -0,0 +1,19 @@ +#!/bin/bash + +# Desc: Template to display date and time. + +dateTimeShort(){ + # Desc: Timestamp without separators (YYYYmmddTHHMMSS+zzzz) + # Usage: dateTimeShort + # Output: stdout: timestamp (ISO-8601, no separators) + TIME_CURRENT="$(date --iso-8601=seconds)" ; # Produce `date`-parsable current timestamp with resolution of 1 second. + TIME_CURRENT_SHORT="$(date -d "$TIME_CURRENT" +%Y%m%dT%H%M%S%z)"; # Produce separator-less current timestamp with resolution 1 second. + echo "$TIME_CURRENT_SHORT"; +} + +#==BEGIN sample code== +echo "The current day and time is:$(dateTimeShort)" +#==END sample code== + +# Author: Steven Baltakatei Sandoval +# License: GPLv3+