#K63572. Date Format Converter
Date Format Converter
Date Format Converter
You are given a string that may contain dates written in the shorthand formats dd/mm/yyyy
or dd-mm-yyyy
. Your task is to convert all such dates into the format Month dd, yyyy
, where Month
is the full English name of the month. For example, the date 21/08/2023
should be converted to August 21, 2023
.
The problem requires careful parsing of the dates and replacing them in the input text. You are expected to read the entire input from standard input (stdin) and output the updated string on standard output (stdout).
Note: Dates in the input are guaranteed to strictly follow one of the two formats. If no date is found, the original text should be output.
The conversion must follow the format:
\(\text{Month} \ dd, \ yyyy\)
inputFormat
The input consists of a string that may span multiple lines. The string is provided via standard input (stdin).
It can include one or more dates in the formats:
dd/mm/yyyy
dd-mm-yyyy
outputFormat
Output the modified string where every date in the shorthand format has been replaced with its corresponding full format: Month dd, yyyy
.
The output should be printed to standard output (stdout).
## sampleThe meeting is scheduled for 21/08/2023 and the deadline is 15-09-2023.
The meeting is scheduled for August 21, 2023 and the deadline is September 15, 2023.