Withinis a preposition.
Within: space
Withinmeans ‘inside or not further than a particular area or space’:
People who livewithinthe city pay higher local taxes than people who live just outside the city.(= the people who live no further than the city boundary or limits)
We’ve always livedwithinten miles of the coast. We love the sea.(We’ve always lived no further than ten miles from the coast.)
Within: time
We can usewithinto refer to time:
I’ve booked train tickets on the Internet. They should arrivewithinthree days.(no later than three days from now)
I’ve noticed her changewithina very short time.
Withindoes not mean the same asin.Withinstresses that something is not further than a particular area or space or not later than a particular time:
Your shirt isinthe drawer.
Not:Your shirt is within the drawer.
I always have teainthe afternoon.
Not:I always have tea within the afternoon.