Skip to content

Instantly share code, notes, and snippets.

@techact
Last active September 12, 2017 07:05
Show Gist options
  • Save techact/bcfd6e69ca38e239bee37e2e0593f70e to your computer and use it in GitHub Desktop.
Save techact/bcfd6e69ca38e239bee37e2e0593f70e to your computer and use it in GitHub Desktop.
Bash Date
#!/bin/bash
given_date="2016-09-21T10:28:41"
echo "$[$[$(date +%s)-$(date -d ${given_date} +%s)]/60/60/24] days"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment