The longer I code the more I appreciate the power of the shell. Getting familiar with common commands is a great way to improve your productivity and over time you amass a massive collection of scripts that allow you to do nearly everything. The most recent utility I discovered was “date”. As expected, it displays the current date and time but it can easily be adapted to display the current datetime in nearly any date format but also allows you to offset the current date in a variety of ways.
➜ ~ date Mon Oct 19 22:35:37 EDT 2015 ➜ ~ date +%Y-%m-%d 2015-10-19 ➜ ~ date +"'%Y-%m-%d'" '2015-10-19' ➜ ~ date -v+3d +%Y-%m-%d 2015-10-22 ➜ ~ date -v-3d +%Y-%m-%d 2015-10-16 ➜ ~ date -v-3y +%Y-%m-%d 2012-10-19 ➜ ~ date -v+3y +%Y-%m-%d 2018-10-19 ➜ ~ date -v+3y +"%Y-%m-%dT%H:%M:%S" 2018-10-19T22:39:18 ➜ ~ date -v+3m +"%Y-%m-%dT%H:%M:%S" 2016-01-19T22:39:24