Basing on this SO question.
Challenge is rather simple: given a date period in the format YYYYMM
output it in the format MMMYY
.
Rules:
- The input will be a number or a string exactly 6 characters long, consisting only of digits.
- Last two digits will be between
01
and12
. - Output must be in the form
MMMYY
, whereMMM
represents uppercase three-letter code for the month (below) andYY
represents two last digits of theYYYY
part of the input.
List of months with corresponding code:
MM MMM
01 JAN
02 FEB
03 MAR
04 APR
05 MAY
06 JUN
07 JUL
08 AUG
09 SEP
10 OCT
11 NOV
12 DEC
Examples:
Input Output
201604 APR16
200001 JAN00
000112 DEC01
123405 MAY34