in reply to Fetching Only Month and Year From localtime()

$year = (localtime())[5] + 1900;