X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/fc1495ab3996d2ded45e6e5ef71d1d256f5eede0..ceadf84262ed4c048b17ae167f5ea9ed96d4d875:/unitproc/bktemp-dateShort?ds=sidebyside diff --git a/unitproc/bktemp-dateShort b/unitproc/bktemp-dateShort index 425cf85..38b39eb 100644 --- a/unitproc/bktemp-dateShort +++ b/unitproc/bktemp-dateShort @@ -6,10 +6,11 @@ dateShort(){ # Desc: Date without separators (YYYYmmdd) # Usage: dateShort # Output: stdout: date (ISO-8601, no separators) + local TIME_CURRENT DATE_CURRENT_SHORT TIME_CURRENT="$(date --iso-8601=seconds)" ; # Produce `date`-parsable current timestamp with resolution of 1 second. DATE_CURRENT_SHORT="$(date -d "$TIME_CURRENT" +%Y%m%d)"; # Produce separator-less current date with resolution 1 day. echo "$DATE_CURRENT_SHORT"; -} # Get date without separators +} # Get YYYYmmdd #==BEGIN sample code== echo "The current day is:$(dateShort)"