Skip to main content
3 of 3
Golfed additional 6 bytes
AdmBorkBork
  • 43.5k
  • 5
  • 103
  • 284

PowerShell, 49 46 40 bytes

date "$args".insert(4,'-')-U %b%y|% *per

Try it online!

Thanks to @Joey for saving 3 bytes!

Takes input $args as an explicit string (e.g., '201604') via command-line input. Uses the string.Insert() function to put a - in the appropriate space, and that resultant string forms input to the Get-Date cmdlet with the -Uformat parameter specifying the three-month shorthand plus two-digit year. We then tack on a .ToUpper() to make the output string capitalized. That string is left on the pipeline and printing is implicit.

Also, as pointed out, this is locale-sensitive. Here's the locale information that I'm using where this works correctly.

PS C:\Tools\Scripts\golfing> get-culture

LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)
AdmBorkBork
  • 43.5k
  • 5
  • 103
  • 284