Skip to content

Instantly share code, notes, and snippets.

@ErnestoRB
Last active October 25, 2022 16:33
Show Gist options
  • Save ErnestoRB/a814db0ce6393a420b279bb4e8574b25 to your computer and use it in GitHub Desktop.
Save ErnestoRB/a814db0ce6393a420b279bb4e8574b25 to your computer and use it in GitHub Desktop.
Get current file last modified date php / Obtener ultima fecha de modificacion archivo actual
<div>
<?php
$nombre_archivo = __FILE__;
if (file_exists($nombre_archivo)) {
echo "La última modificación de $nombre_archivo fue: " . date("F d Y H:i:s.", filemtime($nombre_archivo) - (5* 60 *60) );
}
?>
</div>
@ErnestoRB
Copy link
Author

@Haitore checalo

@Haitore
Copy link

Haitore commented Oct 25, 2022

@ErnestoRB la función filectime es para mostrar la fecha de creación del documento. Para la última modificación es con uso de filemtime.
<?php $archivo = __FILE__; if (file_exists($archivo)) { echo "La última modificación de $archivo fue: " . date("F d Y H:i:s.", filemtime($archivo) + 61200); } ?>

@ErnestoRB
Copy link
Author

@Haitore cierto, ya hice el cambio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment