* Adverb: When used to describe the duration of something, "overnight" modifies a verb, adjective, or another adverb.
* Example: "The bakery stayed open overnight." (modifying the verb "stayed")
* Adjective: When used to describe something that happened during the night, "overnight" modifies a noun.
* Example: "We had an overnight stay at the hotel." (modifying the noun "stay")