|
Posted by Kimmo Laine on 12/05/06 08:55
"Sonnich" <sonnich.jensen@elektrobit.com> wrote in message
news:1165307408.725039.279250@f1g2000cwa.googlegroups.com...
> Hi
>
> I'd like to read out a date from the a DB, but as time var. By default
> I seem to get it as a string.
>
> E.g.
>
> while(odbc_fetch_row($result))
> {
> $tt= odbc_result($result,2);
> echo date("d.m.Y", $tt).", ".odbc_result($result,6) . " <br>";
What kind of a string it is? If it's just a regular Y-m-d string, then the
easiest would be first converting it to unix timestamp and then passing that
to date:
date("d.m.Y", strtotime($tt));
strtotime parses the formatted date string and converts it to integer.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)
[Back to original message]
|