I have been looking for a way to get the creation date of an image, that is, to obtain the date and time that the image was created, and I can't find anything related on the web.
Suppose I have a form, which has several inputs
and among them a input file
, which allows me to upload an image and store its path in the database.
However, how can I get the date and time the image was created?
EYE: Not the date / time it was uploaded from the form, but since the image was taken from the camera.
Is there any way to get that data?
Actually with the filectime function you get the date of the last modification of a file, which I do not know if it is what you are looking for
An example of use:
You can give it the format you want using date()
With
#filectime
you can get the creation date on Windows or the modification date on UNIX-based OS. This function will return the date intimestamp
. Then you can format it, for example:According to your description, the function
exif_read_data(ruta_de_la_imagen)
should be useful to you.I share the link to the php documentation about it, I hope you can solve it. http://php.net/manual/es/function.exif-read-data.php