PHP - File Time-Related Properties

Introduction

The available properties depend on the operating system in which the files are created and modified.

PHP provides three time-related file functions:

Function Description
fileatime() Returns the time at which the file was last accessed as a UNIX timestamp.
filectime() Returns the time at which the file was last changed as a UNIX timestamp.
filemtime() Returns the time at which the file was last modified as a UNIX timestamp.

A UNIX timestamp is an integer value indicating the number of seconds between the UNIX epoch (midnight on January 1, 1970) and the specified time and date.

The getdate() function is useful when working with UNIX timestamps.

It returns an associative array containing the date information present in a timestamp.

Related Topic