In questo tutorial imparerete come creare una semplice funzione che converte il datetime delle API Twitter in formato datetime MySQL.
Per fare quanto detto utilizzeremo la funzione PHP strtotime che ci permetterà di convertire in formato timestamp una stringa.

 
function convert($twitter_datetime = ) {
 
$mysql_format = date("Y-m-d H:i:s", strtotime($twitter_datetime));
 
return $mysql_format;
 
}
 
// SIMPLE USAGE
 
$date = convert("Sat, 15 Oct 2011 00:29:53 +0000");
 
// WILL RETURN 2011-10-14 00:29:53
 

fonte: www.sastgroup.com ? Vai al post originale