J.P. Morgan Interview Question

How to extract month variable from YYYYMMDD string