What Is Their Main Difference?
'In' and 'within' are both correct in the sense of time and location. Their difference is that 'in' is used when there is a specific time or a definite location while 'within' is used when there are boundaries and parameters.
We use 'in' when something is enclosed or surrounded by something else. This could apply to both a time frame or location. 'In' is specific and definite about the location or the time. Have a look:
Here, the subject is 'located' inside a lobby and a building.
Harry woke up
Here, the subject finished an action at a specific time.
'Within' also helps with expressing time and location but there is a small difference. 'Within' needs estimation and parameters to be accurate otherwise the sentence would be hazy and confusing to the audience. Take a look at the following examples:
Here, we are not sure the exact location of the subject other than a general information of its whereabouts.
Here, we know that the subject is inside a exact position of the main location.
Harry will wake up
Here, we know that an action will be done by the subject at a specific time frame.
'In' and 'within' are interchangeable as both prepositions refer to spatial or a logical relationships of two subjects. You need to pay attention that if you are using 'within' instead of 'in,' you need to provide estimation.