Just an obscure corner of the ‘net where I post random stuff – at the moment my focus is on photography, IT and SEO and maybe a bit of quantum physics.… Read More

Bash: Some Date Functions

Some of the date functions I have had to use recently in bash shell Get Current Date today_date=$(date ‘+%Y%m%d’) (in format YYYYMMDD) Get Yesterday yesterday_date=$(date -d yesterday ‘+%Y%m%d’) (in format YYYYMMDD) Get Day of Week dayOfWeekNumber=$(date +%u) (1=Mon) dayOfWeekName=$(date +%A) (Friday) Could pass in a specific date: dayOfWeekNumber=$(date -d”20190821″ +%u) or a variable: dayOfWeekName=$(date -d”{dateToCheck}” +%A)… Read More Bash: Some Date Functions