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
04e601c33f72$33c05450$1100000a@busbydev
Список
Дерево обсуждения
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? Jeff <jam@zoidtechnologies.com>
Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE? Jeff <jam@zoidtechnologies.com>
Oh and also that ugly time value is what happens when you try date('r',-1);
and the -1 comes from strtotime() not being able to convert the datetime
from postgres.

/B

----- Original Message ----- 
From: "Michael Hanna" 
To: "David Busby" 
Cc: 
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));
         ?>
                 

  • notes; ?>

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

  • В списке pgsql-php по дате отправления
    От: David Busby
    Дата:
    От: Christopher Kings-Lynne
    Дата:
    FAQ