Originariamente inviato da Luke70
In che formato viene salvata la data sul tuo DB?
Io così l'ho salvato.
Codice PHP:
$titolo = $_POST['title'];
$post = $_POST['postContent'];
$postTime = time();
$fp = fopen('../news.pos','a');
fwrite($fp, $postTime);
fwrite($fp,'|');
fwrite($fp,$titolo);
fwrite($fp,'|');
fwrite($fp,$post);
fwrite($fp,"||\r\n");
fclose($fp);
Se vado a leggere il file c'è 1302180901, che sono i secondi passati dal 1 Gennaio 1970 se non erro giusto? In ogni caso facendo i test con is_int e is_string mi dice che la variabile postTime è stringa.