Have you looked at the built-in stat function?
In reply to Re: file modification time by steves in thread file modification time by tcf03