Both the DMG and Xanathar's guide offer rules for creating magical items during down time with some elements consistent throughout such as a formula and Gold point cost. They do however, seem to contradict some points and neglect others entirely. The DMG has a strict set of requirements which a character must meet to begin crafting an item which Xanathar's ignores and they both have timescales but Xanathar's has a fixed timescale and the DMG has an incremental timescale which clashes with some abilities that reduce crafting both time and gold required. Xanathar's rules by themselves make more sense for those abilities and for magic item savant which allows artificers to actually craft and use powerful items (which they couldn't with only DMG rules, but are stated to do so nonetheless) but otherwise, the DMG offers more realistic and involved rules that allow money and resources to be provided as time goes on instead of in bulk at the beginning.
Both the DMG and Xanathar's guide offer rules for creating magical items during down time with some elements consistent throughout such as a formula and Gold point cost. They do however, seem to contradict some points and neglect others entirely. The DMG has a strict set of requirements which a character must meet to begin crafting an item which Xanathar's ignores and they both have timescales but Xanathar's has a fixed timescale and the DMG has an incremental timescale which clashes with some abilities that reduce crafting both time and gold required. Xanathar's rules by themselves make more sense for those abilities and for magic item savant which allows artificers to actually craft and use powerful items (which they couldn't with only DMG rules, but are stated to do so nonetheless) but otherwise, the DMG offers more realistic and involved rules that allow money and resources to be provided as time goes on instead of in bulk at the beginning.
In short, which one is it or is it both?
It's entirely up to the DM which they use - if any.
Mega Yahtzee Thread:
Highest 41: brocker2001 (#11,285).
Yahtzee of 2's: Emmber (#36,161).
Lowest 9: JoeltheWalrus (#312), Emmber (#12,505) and Dertinus (#20,953).
Both are optional. By default, PCs have no guaranteed way to get magic items (except artificer).