chore(unitproc):checkMakeTar:Add author, license
[BK-2020-03.git] / unitproc / bktemp-dateTimeShort
... / ...
CommitLineData
1#!/bin/bash
2
3# Desc: Template to display date and time.
4
5dateTimeShort(){
6 # Desc: Timestamp without separators (YYYYmmddTHHMMSS+zzzz)
7 # Usage: dateTimeShort
8 # Output: stdout: timestamp (ISO-8601, no separators)
9 local TIME_CURRENT TIME_CURRENT_SHORT
10 TIME_CURRENT="$(date --iso-8601=seconds)" ; # Produce `date`-parsable current timestamp with resolution of 1 second.
11 TIME_CURRENT_SHORT="$(date -d "$TIME_CURRENT" +%Y%m%dT%H%M%S%z)"; # Produce separator-less current timestamp with resolution 1 second.
12 echo "$TIME_CURRENT_SHORT";
13} # Get date&time without separators
14
15#==BEGIN sample code==
16echo "The current day and time is:$(dateTimeShort)"
17#==END sample code==
18
19# Author: Steven Baltakatei Sandoval
20# License: GPLv3+