Jump to content

Need help with filectime


sg72

Recommended Posts

What i am trying to do is create a page where i can enter a filename in a form and get the creation date of that file.

 

 

This is the html page

<html>
<body>

<form action="c.php" method="post">
Name: <input type="text" name="fname">
<input type="submit">
</form>

</body>
</html>

 

 

 

This is the php page

<?php
$last_mod = filectime("fname");
print("file creation date is ");
print(date("m/j/y h:i", $last_mod));
?>

Link to comment
https://forums.phpfreaks.com/topic/275326-need-help-with-filectime/
Share on other sites

[edit] filectime() is not the creation time of the file. The "c" stands for "change", specifically the change time of the file's inode. Which is not the same as the "m"odification time. It's filesystem stuff.

 

Linux filesystems don't really keep track of the creation time so there's no way to get that there. On Windows filectime() might return a value that's the same as the creation time.

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.