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
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.

Edited by requinix
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.