Created
June 25, 2014 06:51
-
-
Save leocaseiro/c971545202688f42032d to your computer and use it in GitHub Desktop.
Create timestamp from dd/mm/yyyy H:m with PHP >= 5.3
This file contains 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 = '01/06/1985 15:45'; | |
$timestamp = DateTime::createFromFormat('d/m/Y H:i', $datetime)->getTimestamp(); | |
echo $timestamp; | |
$datetime = date('d-m-Y H:i', $timestamp); | |
var_dump($datetime); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment