Reformat Date

Given a date string in the form Day Month Year, where:

Convert the date string to the format YYYY-MM-DD, where:

 

Example 1:

Input: date = "20th Oct 2052"
Output: "2052-10-20"

Example 2:

Input: date = "6th Jun 1933"
Output: "1933-06-06"

Example 3:

Input: date = "26th May 1960"
Output: "1960-05-26"

 

Constraints:

Example Testcases:

"20th Oct 2052"
"6th Jun 1933"
"26th May 1960"