Do not store the timestamp as part of the filename, but store it in the file together with the cached content in some format that makes sense to you. For example:

File /cache/cache_function_random_news:

191982899010
stored content

The first line of the file contains the timestamp, which you can read when needed, e.g. when cleaning the cache periodically. The rest of the file contains the cached content. Another possibility would be to use serialized arrays. Either way, this makes it trivial to read the cache: