From: Manuel Lemos <mlemos@acm.org>
To: ditilupi <gme@ufba.br>
Cc: pgsql-general@postgresql.org
Subject: Re: [SQL] US Date Style
Date: 27 Apr 2000 19:9:49 -0200
Message-ID: <1391.152T2476T11495533mlemos@acm.org> (raw)
In-Reply-To: <Pine.WNT.3.96.1000427144826.161A-100000@sig.rema.ufba.br>
Hello ditilupi,
On 27-Apr-00 15:57:01, you wrote:
>I'm having this problem with date fields. I'm using the Postgresql7.0beta4
>and programming in PHP3. When I set the environment variable PGDATESTYLE
>to "NonEuropean,SQL" it works, but only if I'm in the Pgsql environment.
>When I access through the PHP3 it doesn't work.
You need to add a PHP statement like Putenv("PGDATESTYLE=ISO"); before
connecting with pg_connect or pg_pconnect. Beware that there is a bug in
PHP 4 RC1 that resets this environment variable.
While you are at it, you may want to try Metabase, a database abstraction
package in PHP that comes with a PostgreSQL driver. Among other things
it assures that date fields are always returned in the ISO 8601 standard
format (YYYY-MM-DD).
This format is easier to manage because the fields always occupy fixed
prositions and you may use PHP text sorting and comparision functions to
sort (sort) or compare (strcmp) dates without having to convert them to
time stamp integer values.
Metabase is free. Look here to download it:
http://phpclasses.UpperDesign.com/browse.html/package/20
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
--
E-mail: mlemos@acm.org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--
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-sql@postgresql.org
Cc: mlemos@acm.org, gme@ufba.br, pgsql-general@postgresql.org
Subject: Re: [SQL] US Date Style
In-Reply-To: <1391.152T2476T11495533mlemos@acm.org>
References: <Pine.WNT.3.96.1000427144826.161A-100000@sig.rema.ufba.br> <1391.152T2476T11495533mlemos@acm.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