The unix timestamp started on 1 January 1970 and counts the seconds since then. To get the time stamp from 7 days ago you need to know how many seconds that is. eg.
7(days)*24(hours)60(min)(60 sec) = 604,800
From there you can subtract that from the current timestamp.
time() - 604,800 = time stamp from 7 days ago.
This method will work for any time in the past up until 1 January 1970. Once that is done you can convert that timestamp into any date formate you need.