unix - Get Tuesday and Wednesday next week, with Linux date command -


at linux shell, can like:

date -d "next tuesday" 

to next tuesday.

my issue this: want tuesday of next week. if i'm on monday, want go 7 days forward next week, evaluate "next tuesday". there way chain date evaluations somehow?

to further elaborate, if on wednesday, next week's tuesday 6 days away

date cleverer 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 want tuesday of next week can find start of next week, add day

~: date -d "1 day next monday" tue feb  2 00:00:00 gmt 2016 

if want clear can use

~: date -d "next monday + 1 day" tue feb  2 00:00:00 gmt 2016 

based on charles duffy's comments might worth noting on machine

~: date --version #on rhel6 date (gnu coreutils) 8.4 <license stuff (gplv3)> 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -