The following gives me Wednesday of the current week, i.e. yesterday's date.
I need the date of next week's Wednesday.
How can I do this?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Almost, but you're not quite right with your description of
date -v Wednesday- Wednesday of the current week (past, current, or future)
date -v -Wednesday- last Wednesday (today, or up to six days ago)
date -v +Wednesday- next Wednesday (today, or up to six days in the future)
I notice that for "today" (in my case it's Thursday 21st June 2018), there is no difference in the date for
Thursday; they are all 21st June 2018.
What this means is that it is not possible to get directly to "today" one week in the future. Instead, you have to add one day, and then perform the offset calculation:
date -v +1d -v +Wednesday