Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asdf.sh Secret

Created April 12, 2024 20:42
Show Gist options
  • Select an option

  • Save KyMidd/2dd2a6aaecf36ffcf0c23fdda4464ca8 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/2dd2a6aaecf36ffcf0c23fdda4464ca8 to your computer and use it in GitHub Desktop.
# Get the created date of the user
created_at_date=$(echo "$user_data" | jq -r '.created_at')
echo "Created at date: $created_at_date"
# Convert the created date to epoc
# This uses branching logic because macs don't use GNUtils date
if [ -z "$local_testing" ]; then
created_date_in_epoc=$(date -d $created_at_date +"%s")
else
created_date_in_epoc=$(date -juf "%Y-%m-%dT%H:%M:%S" $created_at_date +%s 2>/dev/null)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment