From: Michael Hanna <zen@hwcn.org>
To: David Busby <busby@pnts.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?
Date: Mon, 30 Jun 2003 21:19:56 -0400
Message-ID: <20099B92-AB62-11D7-A8B3-00039308EB2C@hwcn.org> (raw)
In-Reply-To: <028801c33f43$184e28c0$1100000a@busbydev>
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));
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: zen@hwcn.org, busby@pnts.com
Subject: Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE?
In-Reply-To: <20099B92-AB62-11D7-A8B3-00039308EB2C@hwcn.org>
References: <028801c33f43$184e28c0$1100000a@busbydev> <20099B92-AB62-11D7-A8B3-00039308EB2C@hwcn.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox