Created
December 12, 2013 16:46
-
-
Save cangevine/7931114 to your computer and use it in GitHub Desktop.
Get time and date information from PHP
This file contains hidden or 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 | |
| // Get one aspect of the date, save it as a variable | |
| $hour = date("H"); | |
| $minute = date("i"); | |
| $ampm = date("A"); | |
| // For more information on specifying the format with the letter codes, check here: | |
| // http://www.php.net/manual/en/function.date.php | |
| print("<p>$hour</p>"); | |
| print("<p>$minute</p>"); | |
| print("<p>$ampm</p>"); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment