Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?

Поиск
Список
Период
Сортировка
От David Busby
Тема Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?
Дата
Msg-id 04d601c33f72$0216b4d0$1100000a@busbydev
обсуждение исходный текст
Ответ на Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?  (Michael Hanna <zen@hwcn.org>)
Ответы Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?  (Michael Hanna <zen@hwcn.org>)
Список pgsql-php
Hmmm,
    Sometimes that happens to me too, I cannot seem to isolate what causes
it however.  When I get that I use the PG to_char function in my statement
to convert the value to something I can use in PHP.  I wish I could provide
more information about why this is hit and miss.

/B


----- Original Message -----
From: "Michael Hanna" <zen@hwcn.org>
To: "David Busby" <busby@pnts.com>
Cc: <pgsql-php@postgresql.org>
Sent: Monday, June 30, 2003 18:19
Subject: Re: [PHP] Best way to convert PG's TIMESTAMPTZ to PHP DATE?


for some reason I get:

Wed, 31 Dec 1969 18:59:59 -0500

as output on any entry.

-----

$rows = pg_num_rows($result);

// if records present
if ($rows > 0)
{
         // iterate through resultset
         for ($i=0; $i<$rows; $i++)
         {
                 $row = pg_fetch_object($result, $i);
$conv_date = date('r',strtotime($row->posted));
         ?>
                 <li><font size="-1"><b><? echo $conv_date; ?></b></font>
                 <br>

                 <font size="-1"><? echo $row->notes; ?></font>
                 <p>
         <?
         }
}

On Monday, June 30, 2003, at 04:06  PM, David Busby wrote:

> Both of these work OK for me
>
> date('r',strtotime($record->date_field));
>


В списке pgsql-php по дате отправления:

Предыдущее
От: Michael Hanna
Дата:
Сообщение: Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?
Следующее
От: "David Busby"
Дата:
Сообщение: Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?