Created
November 30, 2013 07:10
-
-
Save anytizer/7716256 to your computer and use it in GitHub Desktop.
Format date into your desired pattern
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 | |
| /** | |
| * Converts YYYY-MM-DD format into DD/MM/YYYY | |
| */ | |
| function _dmy($yyyymmddhhiiss='0000-00-00 00:00:00') | |
| { | |
| $date = substr($yyyymmddhhiiss, 0, 10); | |
| list($yyyy, $mm, $dd) = explode('-', $date); | |
| $dmy = "{$dd}/{$mm}/{$yyyy}"; | |
| return $dmy; | |
| } | |
| echo _dmy('2012-10-25'); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment