When il y a is followed by a time expression (such as longtemps, quelque temps, une semaine, deux jours etc.), it generally means 'ago': il y a une semaine (a week ago).
See also il y a and Il y a ... que.