Re: a new question - Mailing list pgsql-php

From Michael Glaesemann
Subject Re: a new question
Date
Msg-id 33994323d1c711b8d62305747d4eab40@myrealbox.com
Whole thread Raw
In response to Re: a new question  (Todd Lewis <lewis-todd@sbcglobal.net>)
List pgsql-php
> enzo venegas palacios wrote:
>
>> hi, my problem is very basic (and my english too)
>>
>> i have a variable with a date (timestamp format)
>> $fecha = mm-dd-yyy hh:mm:ss
>>
>> i need to display only the date and not the hour
>>
>> $only_date = ??? ($fecha);
>>
>> echo $only_date;
>> display = mm-dd-aaaa

On Mar 18, 2005, at 12:48, Todd Lewis wrote:

> you can use to_char(timestamp,'mm-dd-yyy') where timestamp is your
> couln name. You can place this in your select section.
>

Or you can use extract('epoch' from yourtimestamp) to return an UNIX
timestamp to PHP, and then use PHP's date formating functions.

Michael Glaesemann
grzm myrealbox com


pgsql-php by date:

Previous
From: Todd Lewis
Date:
Subject: Re: a new question
Next
From: Bastiaan Wakkie
Date:
Subject: Re: a new question