The library book must be returned in three weeks.
Adjective
Adverb
In three weeks functions as an adverb modifying the verb must be returned. When must the book be returned? In three weeks.
For more help, see section B3-a.