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/a44e27967bb673c09a681cf12de6356e to your computer and use it in GitHub Desktop.
Save parzibyte/a44e27967bb673c09a681cf12de6356e to your computer and use it in GitHub Desktop.
<?php
/*
Fecha de mañana en PHP, de manera elegante
parzibyte.me/blog
*/
$ahora = time();
# Le decimos que ahora, + 1 día
$manana = strtotime("+1 day", $ahora);
$mananaLegible = date("Y-m-d", $manana);
# ahoraLegible únicamente es para demostrar
$ahoraLegible = date("Y-m-d", $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