feat(unitproc):datetimeShort:Use 1st argument as input date
[BK-2020-03.git] / unitproc / bktemp-dateShort
CommitLineData
fc1495ab
SBS
1#!/bin/bash
2
3# Desc: Template to display date
4
5dateShort(){
6 # Desc: Date without separators (YYYYmmdd)
7 # Usage: dateShort
8 # Output: stdout: date (ISO-8601, no separators)
b03c9c0c 9 local TIME_CURRENT DATE_CURRENT_SHORT
fc1495ab
SBS
10 TIME_CURRENT="$(date --iso-8601=seconds)" ; # Produce `date`-parsable current timestamp with resolution of 1 second.
11 DATE_CURRENT_SHORT="$(date -d "$TIME_CURRENT" +%Y%m%d)"; # Produce separator-less current date with resolution 1 day.
12 echo "$DATE_CURRENT_SHORT";
50aec114 13} # Get YYYYmmdd
fc1495ab
SBS
14
15#==BEGIN sample code==
16echo "The current day is:$(dateShort)"
17#==END sample code==
18
19# Author: Steven Baltakatei Sandoval
20# License: GPLv3+