It depends on your definition of "not theirs". The law doesn't look at biology only. (Same gender parents, adoptive parents, grandparents as primary caregivers, etc).
If you accept a child as your own for several years, the law is likely to look at them as yours regardless of DNA. I think that in the majority of cases, this probably works out for the better.
If you accept a child as your own for several years, the law is likely to look at them as yours regardless of DNA. I think that in the majority of cases, this probably works out for the better.