Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 7, 2019 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/b2a34f732dcb359978d61c05fd088997 to your computer and use it in GitHub Desktop.
Save parzibyte/b2a34f732dcb359978d61c05fd088997 to your computer and use it in GitHub Desktop.
<?php
/*
Fecha de mañana en PHP, con precisión de segundos
parzibyte.me/blog
*/
$ahora = time();
$unDiaEnSegundos = 24 * 60 * 60;
$manana = $ahora + $unDiaEnSegundos;
$mananaLegible = date("Y-m-d H:i:s", $manana);
# ahoraLegible únicamente es para demostrar
$ahoraLegible = date("Y-m-d H:i:s", $ahora);
echo "Hoy es $ahoraLegible y mañana es $mananaLegible";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment