X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/ea8ea560b8fd5d0ce500ef462eb0142c419167a5..ceadf84262ed4c048b17ae167f5ea9ed96d4d875:/unitproc/bktemp-dateTimeShort?ds=sidebyside diff --git a/unitproc/bktemp-dateTimeShort b/unitproc/bktemp-dateTimeShort index d6491c1..fe30617 100644 --- a/unitproc/bktemp-dateTimeShort +++ b/unitproc/bktemp-dateTimeShort @@ -6,10 +6,11 @@ dateTimeShort(){ # Desc: Timestamp without separators (YYYYmmddTHHMMSS+zzzz) # Usage: dateTimeShort # Output: stdout: timestamp (ISO-8601, no separators) + local TIME_CURRENT TIME_CURRENT_SHORT 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"; -} +} # Get date&time without separators #==BEGIN sample code== echo "The current day and time is:$(dateTimeShort)"