Skip to content

Instantly share code, notes, and snippets.

@thombashi
Created January 22, 2017 05:21
Show Gist options
  • Save thombashi/8c687deab8e2b3e3e016341df4b08b96 to your computer and use it in GitHub Desktop.
Save thombashi/8c687deab8e2b3e3e016341df4b08b96 to your computer and use it in GitHub Desktop.
date command with ISO8601 format
#!/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