Time-dependent study of magnetic fields in comets giacobini-zinner and halley