Re: Date type: DATE - Mailing list pgsql-php

From Adrian Tineo
Subject Re: Date type: DATE
Date
Msg-id 001f01c2c2f1$9255d240$f8ddd8d9@supercable.es
Whole thread Raw
In response to Date type: DATE  (Jesus Rios <galiza-vermelha@wanadoo.es>)
List 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


pgsql-php by date:

Previous
From: Kevin Gordon
Date:
Subject: Re: postgresql primarykeys foreignkeys tablenames
Next
From: sector119@mail.ru
Date:
Subject: connect to PostgreSQL over SSL from PHP