Created
July 17, 2019 11:17
-
-
Save alrnz/592f0b89b78d8ff0f065ce4b70f180fd to your computer and use it in GitHub Desktop.
[Convert German Date to timestamp] Convert dates like 31.5.2019 to timestamp #PHP #Timestamp
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
private function strtotime_de($input = '20.5.2019'){ | |
if ( preg_match('/^(?P<day>\d+)[\.-\/](?P<month>\d+)[\.-\/](?P<year>\d+)$/', $input, $matches) ) | |
{ | |
$timestamp = mktime(12, 0, 0, $matches['month'], $matches['day'], $matches['year']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment