Skip to content

Instantly share code, notes, and snippets.

@stormisOld
Last active September 2, 2019 13:32
Show Gist options
  • Save stormisOld/54df5debd52c5176113d147d497a84d8 to your computer and use it in GitHub Desktop.
Save stormisOld/54df5debd52c5176113d147d497a84d8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Made by st0rmis
if [ -n "$1" ]; then
echo "$(date -j -f "%Y-%m-%d" "$1" +"%s")"
else
read -p "Please enter a date in YYYY-MM-DD format: " DATE1
echo "The UNIX time for $DATE1 is $(date -j -f "%Y-%m-%d" "$DATE1" +"%s")"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment