Reply to Re: Getting date (timestamp) as time value?

Your name:

Reply:


Posted by Sonnich on 12/05/06 10:37

Kimmo Laine wrote:
> "Sonnich" <sonnich.jensen@elektrobit.com> wrote in message
> news:1165309352.222966.35270@16g2000cwy.googlegroups.com...
> >
> > 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
>
> Then strtotime is your friend. Just pass the timestring the server gives to
> strtotime and use the timestamp it returns.

jup, but I'd also like to check whether <> null... I found a way though.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация