In a way, you’re all right.
Most glass, in cars or houses, blocks the kind of sunlight, called ultraviolet B (or UVB), that causes sunburns, said Dr. Robert Stern, chief of dermatology at Beth Israel Deaconess Medical Center. So you’re unlikely to get truly burned through the window. But glass does let in ultraviolet A (UVA) light, which can cause suntans, though rarely burns. It could take hours, though, to get a tan trying to use your car as your tanning salon.