Can wearing a foundation with SPF protect your skin from UV damage?

Because sunspots are not a vibe!