From ea8ea560b8fd5d0ce500ef462eb0142c419167a5 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Sun, 28 Jun 2020 19:48:33 +0000 Subject: [PATCH] feat(unitproc):Add dateTimeShort to get short timestamp --- unitproc/bktemp-dateTimeShort | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 unitproc/bktemp-dateTimeShort 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+ -- 2.30.2