Skip to content

Instantly share code, notes, and snippets.

@rlindooren
Created April 23, 2024 10:42
Show Gist options
  • Save rlindooren/6202a79a9d40fb5dd209fc2a7e54b04f to your computer and use it in GitHub Desktop.
Save rlindooren/6202a79a9d40fb5dd209fc2a7e54b04f to your computer and use it in GitHub Desktop.
Linux/MacOS date
if [[ "$OSTYPE" == "darwin"* ]]; then
YEAR_AGO=$(date -v-365d +"%Y-%m-%d")
else
YEAR_AGO=$(date -d "365 day ago" +"%Y-%m-%d")
fi
YEAR_AGO_ISO="${YEAR_AGO}T00:00:00"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment