easyString 0 views

Reformat Date

Given a date string in the form Day Month Year, where: Convert the date string to the format YYYY-MM-DD, where:

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

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

Reformat Date diagram

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

  • The given dates are guaranteed to be valid, so no error handling is necessary.

Hints

Companies

No companies reported yet.

Discussion

Sign in to join the discussion.

Loading discussion...

Test results

No test cases yet.