Get a file's date and time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rashedkarim
Forum Newbie
Posts: 2
Joined: Thu Jun 02, 2005 5:26 pm

Get a file's date and time

Post by rashedkarim »

How can i make php get a file's (on the server) creation time/date?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

I'm pretty sure on a windows server you can't get the creation date/time.

you can use stat() to get other information, but I don't believe you can get the creation date. If you're using unix, I remember reading a while back taht you can hack your way into determining the creation date, but I don't recall where.

try searching this forum for "file creation date"
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

"filemtime" does the job, for getting time of last modification (should work on Windows as far as I know)

However creation time is not available though as far as I know, not available on Linux I believe...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Syranide wrote:However creation time is not available though as far as I know, not available on Linux I believe...
Doesn't filectime() do this?
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

filectime -- Gets inode change time of file

nope! :P
Post Reply