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

From: Michael Hanna <zen(at)hwcn(dot)org>
To: "David Busby" <busby(at)pnts(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?
Date: 2003-07-01 01:19:56
Message-ID: 20099B92-AB62-11D7-A8B3-00039308EB2C@hwcn.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

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));
>

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message David Busby 2003-07-01 01:42:05 Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?
Previous Message Jeff 2003-06-30 22:22:59 Re: PHP form Creates Blank DB entries