Powered by ChatGPT, Gemini and Claude
// Get file creation time
$creationTime = filectime($filePath);
// Format the creation time as a human-readable date
return date("Y-m-d H:i:s", $creationTime);
}
// Example usage: $filePath = 'example.txt'; // Replace with your file path $creationDate = getFileCreationDate($filePath);
if ($creationDate !== false) { echo "The file was created on: " . $creationDate; } else { echo "File does not exist."; } ?>