Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Date Last Modified

Status
Not open for further replies.

manitoba

Programmer
Jan 29, 2004
79
0
0
CA
Hi,

This seems like a supid question but how do you get a file's last modified date? I see the function filemtime() to get the last modified time but where is the filemdate()?

Thanks.
 
PHP.net explains how to use filemtime() to display the file modified date.

*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
 
manitoba,

Here's a code snippet I use often:
Code:
This page was last updated on
<?php
$last_modified = filemtime("index.php");
print(date("F jS Y", $last_modified));
echo(" at ");
print(date("g:i a", $last_modified));
?>

If you need to port this code over to another file, you'd just change the reference to the file name.

Wishdiak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top