Created
January 22, 2017 05:27
-
-
Save thombashi/2b8a2c49f8eaf03bb97433cfaa9c5715 to your computer and use it in GitHub Desktop.
date command with RFC-2822/RFC-3399 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 --rfc-3339=$1" | |
echo "$ ${command}" | |
echo -e "`${command}`\n" | |
} | |
echo -e "--- date command output with RFC 2822 format ---" | |
command="date --rfc-2822" | |
echo "$ ${command}" | |
echo -e "`${command}`\n" | |
echo -e "--- date command output with RFC 3399 format ---" | |
for format in date 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