Jump to content

Displaying the date/time a file is uploaded


whatap

Recommended Posts

Hello, I've been trying to get my upload script to display the time and date files are uploaded through my upload script. I just can't get it working. I've tried to make the script touch the file right after it's uploaded and display the date the file was modified as a workaround, but everything I do displays the date as 1969-12-31 18:00.

 

Can anyone give me some insight as to how I can correctly show the time files are uploaded?

PHP does that when it cannot find the file.

 

This code will display the last modified, the file needs to exist on the server, or you will get: Page Last Edited 12/31/69 04:00

 

So either it doesn't exist, or your path is incorrect.

 

<?php
$last_modified = filemtime("index.php");
print("Page Last Edited");
print(date("m/j/y h:i", $last_modified));
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.