Skip to content

Instantly share code, notes, and snippets.

@gsharp
Last active August 29, 2015 14:08
Show Gist options
  • Save gsharp/1eeb182de83d784dd7b0 to your computer and use it in GitHub Desktop.
Save gsharp/1eeb182de83d784dd7b0 to your computer and use it in GitHub Desktop.
time to new year
export epoch=$(($(date -j -f "%d-%B-%y" 01-JAN-15 +%s) - $(date +%s)));
printf "\n\nTime from now to new year! \n\n months: %s\n weeks: %s\n days: %s\n hours: %s\n minutes: %s\n" $(($epoch / 2629743)) $(($epoch / 604800)) $(expr $epoch / 86400) $(expr $epoch / 3600) $(($epoch / 60));
unset epoch;
@gsharp
Copy link
Author

gsharp commented Oct 29, 2014

output sample:

Time from now to new year! 

 months: 2
 weeks: 9
 days: 64
 hours: 1537
 minutes: 92220

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