Created
July 18, 2015 12:39
-
-
Save jeff1evesque/4540da7f91ad884d6ebc to your computer and use it in GitHub Desktop.
Convert date string to unix time
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
// date to convert | |
$date_string = 'Thursday, July 9, 2015 - 14:54' | |
// conversion logic | |
$time = str_replace(' - ', ' ', $date_string); | |
$epoch = strtotime($time); | |
// converted unix time | |
var_dump($epoch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment