Skip to content

Instantly share code, notes, and snippets.

@gist-loraxx753
Created October 2, 2012 00:07
Show Gist options
  • Save gist-loraxx753/3815332 to your computer and use it in GitHub Desktop.
Save gist-loraxx753/3815332 to your computer and use it in GitHub Desktop.
string to date and back
<?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