Re: Date type: DATE

From: "Adrian Tineo" <adriantineo(at)softhome(dot)net>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: Date type: DATE
Date: 2003-01-23 15:10:22
Message-ID: 001f01c2c2f1$9255d240$f8ddd8d9@supercable.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php


> $date="$year-$month-$day";
> insert into s_objetivos_caso values ($dni,$date,$cod_s_objetivos,$conn);

By default, postgresql uses "ISO with US(NonEuropean) conventions" for the
date, wich means mm/dd/yyyy. You can check that with "show datestyle". Of
course, you can change the convention to a European one like dd/mm/yyyy but
I don't know how to make it permanent.... anyway, if we stick to the default
US convention you would do something like:

$date=$month ."/". $day ."/" $year; // Use the dot (.) to join strings

And then do the insert.

Adrian Tineo

In response to

Browse pgsql-php by date

  From Date Subject
Next Message sector119 2003-01-23 15:48:05 connect to PostgreSQL over SSL from PHP
Previous Message Kevin Gordon 2003-01-23 08:05:55 Re: postgresql primarykeys foreignkeys tablenames