Locality of $C^2$ Regularity