Last active
January 13, 2016 08:14
-
-
Save nucreativa/a2879a6ec313525b7fbf to your computer and use it in GitHub Desktop.
Function to convert date format
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 | |
function convertDate($oldFormat, $newFormat, $date) | |
{ | |
$myDateTime = DateTime::createFromFormat($oldFormat, $date); | |
return $myDateTime->format($newFormat); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment