Certain types of moisturisers and foundations contain added protection from UV rays to help combat the rays' anti-ageing effects, because it's well-known that being out and about in strong daylight - even when it's not that sunny - can contribute to the ageing process. Such products are not intended to be used as primary sun protection: their main function is as a moisturiser or foundation and should be used in the same way you would use any other product of that type. If you're wearing these products and you're going to spend time in the sun, you still need to apply sunscreen.
See What are the different types of sunscreen? for more information.