Only if you were safe in His arms and you correctly heard His voice(God) that you would be in obedience to Him by doing so. Obeying His voice is always the right thing to do, however, if you are just doing it from your own decision or even imagining His voice, fasting for this length could be very dangerous.