Paull
Paull

Reputation: 5

php get empty directory modification time?

I can get directory modification time with recursive method (scandir), but if directory was empty or new empty directory was created by mkdir:

mkdir('newdir');
// how get 'newdir' modification time

I search similar posts and google pages but problem not solved

Upvotes: 0

Views: 59

Answers (1)

Jon
Jon

Reputation: 437914

You are looking for filemtime:

echo date ('F d Y H:i:s', filemtime('newdir'));

Upvotes: 4

Related Questions