Last active
June 26, 2019 09:25
-
-
Save JRyven/aa6aabf112377e8987302c9f4336e142 to your computer and use it in GitHub Desktop.
PHP Date Functions and Transformations
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 the current date array | $thedate[0] contains the unix timestamp | |
$thedate = getdate(); | |
// Make a date object using pretty much any human redable date/time | |
$date_object = strtotime(9-5-1985 1:00 AM); | |
// Format the date object | |
$date_formatted = date('Y-m-d', $date_object); | |
// Make a date object using pretty much any human redable date/time & format! | |
$event_start_date_unix = date('U', strtotime(9-5-1985 1:00 AM)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment