Forum Moderators: coopster
I've got this, but it wont give me the right date, what am I doing wrong:
<?
$last_modified = filemtime("gp_submissions2.pdf");
print("");
print(date("m/j/y h:i", $last_modified));
?>
Thanks.
[edited by: Champak at 9:40 pm (utc) on Feb. 2, 2007]
In either case, I wish you luck! :)
[edit]
Looks like you changed your whole post ;)
Well, what you have works fine, however it gives the time that the file was last modified. You, however, want the time of upload. I'm afraid you are going to have to log a timestamp to be 100% sure, unless you know that the files will never be modified after the upload date, in which case your solution should work.
[/edit]
<?
$last_modified = filemtime("/path/downloads/gp_submissions2.pdf");
print("");
print(date("m/j/y h:i", $last_modified));
?>
So for anyone else who may have this problem because the file they want to check is in a subdirectory, to solve it make the path from the from the root like: /home/whatever/public_html/path/file.pdf
I actually want the modified date, not the upload date, so it is giving me what I expect.
[edited by: Champak at 2:10 am (utc) on Feb. 3, 2007]