Where It All Goes Down
Saint Petersburg, Russia (Not Spain or China), Early 19th Century
Poprishchin wastes no time at the beginning of the story to start complaining about all those corrupt provincials with their fancy houses. So we know right away that he's in some big city. But when he starts dropping street names (1.4), we savvy readers of the story know it must be all going down in Saint Petersburg, Russia.
At the time Gogol was writing this story, Saint Petersburg had been falling from its glory as the Western face of Russia. Suddenly, people weren't so into its extremely, uh, perpendicular angles, and cold, unfriendly facades. Like Poprishchin, many people felt stuck in a social class system where there wasn't much chance of moving up in life. (Source: Maguire, Robert A. Introduction. The Diary of a Madman, The Government Inspector and Selected Stories. By Nikolay Gogol. Trans. with Notes by Ronald Wilks. New York: Penguin Classics, 2005. vxiii-xx. Print.) Unless you marry rich or become the King of Spain. Then in 1824, the city was flooded. The waters rose to a 13.8-foot surge (that tops Hurricane Sandy), and really crushed the city dwellers' spirits.
Of course, in the second part of the story, Poprishchin claims he is in Spain, which is the same place as China. And then when he says he got to Spain in half an hour and sees a lot of people with shaved heads, we know he is probably still in Saint Petersburg, but in an insane asylum. Poprishchin describes the asylum as if it were a foreign country with strange customs. But actually it's a pretty accurate picture of what asylums were like back then, especially in big cities and even more especially for the poor: "I saw a lot of people with shaved heads" (17.1), "…there is a terrible stench all over the earth, so that you have to hold your nose" (17.1), "But I cannot even remember how I felt when they began dripping cold water on my head" (18.1).
So in case we were thinking 19th-century Saint Petersburg is a nice place, what with all those noble types with fancy clothes and French books, Gogol makes sure that we get it: no, it really is not a nice place for everyone, especially if you're sick, poor, or just plain unimportant.
And finally, there are those weird dates in the diary (check out "Symbols, Imagery, Allegory" for more on that). We're sane enough to look at the cultural and historical references ("Allusions") in the story, and guess that it most likely takes place in 1833-1834.