Skip to content

Instantly share code, notes, and snippets.

@evindunn
Last active February 17, 2022 23:15
Show Gist options
  • Save evindunn/35ba0430e221adcd174a18c98cde3678 to your computer and use it in GitHub Desktop.
Save evindunn/35ba0430e221adcd174a18c98cde3678 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -lt 1 ]; then
echo Provide a date to convert
exit 1
fi
# Provide 'Fri 18 Feb 2022 05:30:00 PM PST'
DATE=$1
MY_TIME=$(date -d "$DATE")
UTC_TIME=$(date -d "$DATE")
echo "Target Time: $DATE"
echo " My Time: $MY_TIME"
echo " UTC Time: $UTC_TIME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment