NeBaut.net |
#!/bin/bash
#
# Timestamp shell converter
if [[ "$1" == "-c" ]]; then
date -d '1970-01-01 '$2' sec'
else
if [[ "$1" == "-g" ]]; then
date -d "$2" +%s
else
echo "Usage:"
echo " - Convert to normal date format from timestamp format"
echo ' timestamp.sh -c "
echo " - Generate timestamp date from normal date"
echo ' timestamp.sh -g
fi
fi