The accurate measurement of the weak geomagnetic field is of significance for different disciplines. It can provide sufficient navigation information for both human beings and different natural animal species. Inspired by avian magnetoreception models, we consider the feasibility of utilizing quantum coherence phenomena to measure weak static magnetic fields. We propose an experimentally feasible scheme to measure weak static magnetic fields with nitrogen-vacancy color center in diamond. Nitrogen-vacancy color centers are regarded as an ideal platform to study quantum science as a result of its long coherence time up to a millisecond timescale at room temperature. In a high-purity diamond, the hyperfine interaction with the surrounding 13C nuclear spins dominates the decoherence process. In this paper, by the cluster-correlation expansion, we numerically simulate the decoherence process between|0⟩ ightangle and|+1⟩ ightangle states of the individual nitrogen-vacancy color center electron spin in the 13C nuclear-spin baths with various magnitudes of external magnetic fields. By applying the Hahn echo pulse sequence to the system, we obtain the coherence of the nitrogen-vacancy color center electron spin as a function of total evolution time and magnetic field. Furthermore, we obtain the high-accuracy relationship between the three decoherence-characteristic timescales, i.e., TW, TR, T2, and magnetic field B. Finally, we draw a conclusion that TR has the highest sensitivity to the magnetic field in the three timescales. Thus, for a certain nitrogen-vacancy color center, TR can be the scale for the magnitude of the magnetic field, or rather, the component along the nitrogen-vacancy electronic spin axis. When measuring an unknown magnetic field, we adjust the nitrogen-vacancy axis to the three mutually orthogonal directions respectively. By this means, we obtain the three components of the magnetic field and thus the magnitude and direction of the actual magnetic field. The accuracy can reach as high as 60 nT·Hz-1/2, and can be further improved by using an ensemble of nitrogen-vacancy color centers or diamond crystals purified with 12C atoms. In summary, our scheme may provide an alternative method of accurately measuring the weak geomagnetic field by the nitrogen-vacancy color center under ambient condition.