At a Linux shell, you can do something like:
date -d "next Tuesday"
To get next Tuesday.
My issue is this: I want to get Tuesday of NEXT WEEK. So if I'm currently on Monday, I want it to go 7 days forward to next week, then evaluate "next Tuesday". Is there a way to chain the date evaluations somehow?
To further elaborate, if I am on a Wednesday, then next week's Tuesday is just 6 days away
date
is cleverer than you'd think
~: date -d "next tuesday"
Tue Feb 2 00:00:00 GMT 2016
~: date -d "1 week next tuesday"
Tue Feb 9 00:00:00 GMT 2016
~:
If you want to get the Tuesday of next week you can find the start of next week, then add a day
~: date -d "1 day next monday"
Tue Feb 2 00:00:00 GMT 2016
If you want it to be slightly clear you can use
~: date -d "next Monday + 1 day"
Tue Feb 2 00:00:00 GMT 2016
Based on Charles Duffy's comments it might be worth noting on my machine
~: date --version #on RHEL6
date (GNU coreutils) 8.4
<license stuff (GPLv3)>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With