Created
October 2, 2012 00:07
-
-
Save gist-loraxx753/3815332 to your computer and use it in GitHub Desktop.
string to date and back
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 | |
//September 15,2013 | |
$date = "2013-09-15"; | |
$utc = strtotime($date); | |
//Stuff to put it into the database (int 32) | |
//Sort by Date ASC/DES | |
//$array['date'] this is your utc timestamp 35135103513420.= | |
//http://php.net/manual/en/function.date.php | |
$realtime = date("m-d-Y", $array['date']); | |
echo $realtime; | |
//prints 09-15-2013 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment