Created
August 7, 2019 21:57
-
-
Save parzibyte/a44e27967bb673c09a681cf12de6356e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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