If there are hourly feeds that are being generated based on time, the we can use the following snippet to go back in time for 2 hours and generate the filename based on requirement.

$timenow=time()-(2*60*60); // Gives the time 2 hours before.

$consfeed= strftime “data_%Y_%m_%d_%H_00_00.xml”, localtime($timenow); // Constructs the filename to be looked for 2 hours before.

Blogged with Flock