Two dates on the same tube
If the tube expires next month, opening it today does not give you another year. Conversely, if the indicated opening period has already ended, replace it even if the printed expiry is still ahead.
What if the expiry date has rubbed off?
Check the original carton. If you still cannot find a date, give the manufacturer the lot and product name. A batch lookup may help date manufacture but cannot establish how much SPF remains in this bottle.
Taking sunscreen to the beach
Follow the storage instructions. Keep the bottle shaded, wrap it in a towel or put it in a bag when outdoors. Replace expired sunscreen even if it looks the same as when you bought it.