Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dufferzafar/1345ea43e94e0d816711 to your computer and use it in GitHub Desktop.
Save dufferzafar/1345ea43e94e0d816711 to your computer and use it in GitHub Desktop.
Command line utility to find number of days to a date. #go #cli #ideabin

Examples:

days -m | -y                # Print number of days left in the month/year

days "Aug 31"               # This year

days "Aug 31, 2016"         # Exact date

days "31/08/2019"           # Alternate date format

Prior Art

The dateutils package (github) contains almost everything that can be done with dates. Too bad, it's *nix only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment