|
Posted by Sonnich on 12/05/06 09:02
Kimmo Laine wrote:
> "Sonnich" <sonnich.jensen@elektrobit.com> wrote in message
> news:1165307408.725039.279250@f1g2000cwa.googlegroups.com...
> > 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.
Server default format, I guess....
2006-12-05 00:00:00
Navigation:
[Reply to this message]
|