N.M. Stat. § 31-20-12
Credit for time prior to conviction.
A person held in official confinement on suspicion or charges of the commission of a
felony shall, upon conviction of that or a lesser included offense, be given credit for the
period spent in presentence confinement against any sentence finally imposed for that
offense.