Skip to content

Instantly share code, notes, and snippets.

@ErnestoRB
Created October 22, 2022 04:40
Show Gist options
  • Save ErnestoRB/be195876d8a62cf8114fbc716c3e1a4a to your computer and use it in GitHub Desktop.
Save ErnestoRB/be195876d8a62cf8114fbc716c3e1a4a to your computer and use it in GitHub Desktop.
Get last modified post datetime PHP Wordpress
<?php
$last_date = get_lastpostmodified('blog'); // obtiene la fecha de la ultima modificacion a un post
$last_time = strtotime($last_date); // convierte a numeros para poderla formatear
echo "La última fecha de modificación fue el ". date("j / M / Y \a \l\a\s H:i:s", $last_time); // formatea
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment