Within can be used in the following ways:
as a preposition (followed by a noun):
Can you complete the work within a month?
1 inside a period of time
a.
before the end of a period of time
We expect an announcement within the next 24 hours.
The military government has promised to hold free and fair elections within six months.
b.
during a particular period of time
Within the past few weeks, 215 people have been arrested.
https://www.macmillandictionary.com/dictionary/british/within