The item having the newest PubDate should become the lastBuildTime.
[EDIT]: If there is a separate PubDate you are using too for whole feed, then lastBuildTime should be current time because you are building it at current time on-demand :).
[EDIT]: 2:: As lastBuildTime
is optional and you’re anyways including PubDate for whole feed, why not remove it from your feed output?
1
solved lastBuildDate in dynamically generated RSS