The line which indicates the time when the events of “The Raven” occur is the following one:
"Once upon a midnight dreary..."
It is an example of an adverbial phrase, which answers the question: "when?". It cannot be simply called an adverb, since it does not consist of a single word, such as yesterday, tomorrow or today. It is rather an adverbial phrase because it consists of a group of words that work as an adverb. In the case at hand, it functions as an adverb of time.