Created
January 22, 2017 05:21
-
-
Save thombashi/8c687deab8e2b3e3e016341df4b08b96 to your computer and use it in GitHub Desktop.
date command with ISO8601 format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function date_wrapper() { | |
command="date --iso-8601=$1" | |
echo "$ ${command}" | |
echo -e "`${command}`\n" | |
} | |
echo -e "date command output with ISO8601 format.\n" | |
command="date --iso-8601" | |
echo "$ ${command}" | |
echo -e "`${command}`\n" | |
for format in date hours minutes seconds ns | |
do | |
date_wrapper ${format} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment