$century = int($dt->year / 100)+1; $millennium = int($dt->year / 1000)+1;