For my personal experience, to distinguish whether a pair of sunglasses has the function of blocking ultraviolet rays, you can find obvious signs such as "anti-ultraviolet" and "UV400" on the label or lenses of the sunglasses.
When I buy sunglasses, I usually buy them in the exclusive optical store, and pay attention if there are the labels of "UV400" and "anti-ultraviolet" on the lenses and outside packages. Otherwise I won’t but them.
Besides the common labels of "UV400" and "anti-ultraviolet", I know an operation to distinguish them! Uv tester. Just place the lenses under the test instrument, you can immediately measure the index for blocking ltraviolet ray.