indicates time (period) over which action takes place
Noun (Time Period) +
The particle
Spending or passing a duration
In this context,
楽しい時
To spend a happy time.
一週間
A week passes / goes by.
一日
To end/finish the day.
This usage is semantically linked to the 'space/path'