When was The Raven written?

Edgar Allan Poe's poem 'The Raven' was first published on January 29, 1845. So, it was presumably written shortly before this date.