Hi, $ date -d 'last Tue' +%Y-%m-%d 2021-07-13 $ date +%Y-%m-%d 2021-07-20 $ date -d 'last Mon' +%Y-%m-%d 2021-07-19
I want to get the last day of week not in the future. In the above example, I want to get this Tue (2021-07-20) instead the last Tue (2021-07-13). But for Mon, I want to get 2021-07-19. Is there a date string to get such output? -- Regards, Peng