Skip to content

Instantly share code, notes, and snippets.

@damc-dev
Created December 7, 2016 17:20
Show Gist options
  • Save damc-dev/69e27d698569ed362299e0b20cdcd217 to your computer and use it in GitHub Desktop.
Save damc-dev/69e27d698569ed362299e0b20cdcd217 to your computer and use it in GitHub Desktop.
Example date formatting
#!/bin/sh
# Datetime in local timezone
echo "* $(date +'%Z'): $(date +'%Y-%m-%dT%H:%M:%S.%N%:z')"
# Datetime in specified timezone
echo "$(TZ=UTC date +'%Z'): $(TZ=UTC date +'%Y-%m-%dT%H:%M:%S.%N%:z')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment