OK lets say I have a string that changes everyday that contains the date in it
var receiveddate = "Received on Saturday 14th of July 2018"
how do I extract the date out of it to example formatreceiveddate = "2018-07-14"
I know the other way around is to use string interpolation and template literals but not how to reverse it
So what I really is asking how to transform this
Received on Saturday 14th of July 2018
Received on Saturday 5th of May 2018
Received on Monday 8th of January 2018
Received on Wednesday 19th of July 2017
Received on Sunday 1st of July 2018
Received on Tuesday 3rd of July 2018
Received on Saturday 2nd of June 2018
Received on Thursday 21st of June 2018
Received on Thursday 31st of May 2018
into this 2018-07-14
for each date.