Solenoid operated variable valve timing for internal combustion engines