date of a specific past day

Can I print the date of a specific date?

Let say, today is 20 and I want to print in date format the day 14

I know that I can do this:

date --date='last Mon'

but

How can I do this?:

date --date='last 14'

??

if you have GNU date just go through the man pag..

I already read it

you want date which is 14 days back from current date or you want to know which day of the week was it 14 days before current date or you want to know which day of the week is it 14th day of a month??

that

I already know that n days back form current date I can do:

date --date='n day ago'

the red highlighted is what I need

Here you go sir..
if you want specific month and year please help yourself....

 
cal|awk 'NR==2{day=$0};/14/{print substr(day,index($0,"14"),3)}'

1 Like

heyy, that's great, thanks a lot !

solved thread

thanks for the help