J.P. Morgan interview question

How to extract month variable from YYYYMMDD string