When did West Virginia break away from Virginia?

It was declared a new state in 1863, seceding from Virginia and the Confederacy - a welcome gift for Lincoln.