What year did Charles Perrault write Cinderella?

Why did Charles Perrault Write Cinderella??? somebody please answer this NOW!!!! :)