Page 1 of 1

Timestamp ...

Posted: Thu Aug 28, 2008 5:35 pm
by stevoo
Me again :)

So i get a timestamp from my psql database and it is returned like this
2008-08-28 23:12:25.275871

Now i try to truncate it with php like this

Code: Select all

while($row = pg_fetch_array($result)){
        $tomorrow = mktime($row['newtime']);
        echo $row['newtime']; 
        echo " - ".date("y/m/d", $tomorrow);
but it will not give me the correct results ...
it will instead return me this

2008-08-28 23:12:25.275871 - 08/11/19
2008-08-28 20:45:04.281969 - 08/11/19
2008-08-28 18:57:55.362821 - 08/11/19

Re: Timestamp ...

Posted: Thu Aug 28, 2008 6:05 pm
by jayshields
Have you read about mktime() in the manual?