Last active
June 19, 2019 14:52
-
-
Save YurePereira/ce9bb1ec2aa34294e6609d497a1ac093 to your computer and use it in GitHub Desktop.
Usando os métodos setDate e setTime para definir datas
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 | |
| $dateTime = new DateTime(); | |
| //Date | |
| $year = 2000; $month = 10; $day = 12; | |
| //Time | |
| $hour = 9; $minute = 1; $second = 10; | |
| $dateTime->setDate($year, $month, $day); | |
| $dateTime->setTime($hour, $minute, $second); | |
| echo $dateTime->format('d/m/Y H:i:s'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment