Nucleotidase that shows high phosphatase activity toward non-canonical pyrimidine nucleotides and three canonical nucleoside 5'-monophosphates (UMP, dUMP, and dTMP), and very low activity against TDP, IMP, UDP, GMP, dGMP, AMP, dAMP, and 6-phosphogluconate. Appears to function as a house-cleaning nucleotidase in vivo, since the general nucleotidase activity of YjjG allows it to protect cells against non-canonical pyrimidine derivatives such as 5-fluoro-2'-deoxyuridine, 5-fluorouridine, 5-fluoroorotate, 5-fluorouracil, and 5-aza-2'-deoxycytidine, and prevents the incorporation of potentially mutagenic nucleotides into DNA. Its dUMP phosphatase activity that catalyzes the hydrolysis of dUMP to deoxyuridine is necessary for thymine utilization via the thymine salvage pathway. Is strictly specific to substrates with 5'-phosphates and shows no activity against nucleoside 2'- or 3'-monophosphates.