It was written between September 1501 and March 1502, with additions until about 1505.
The writing process took place from September 1501 to March 1502, with subsequent refinements made until roughly 1505.