Обсуждение: Get Date value from Datum

Поиск
Список
Период
Сортировка

Get Date value from Datum

От
"Zhe He"
Дата:
Hi,<br />I met some problem with get date type value<br />from a table. I have a Datum which stores this<br />value as
aninteger and I want to get its date<br />value. Is there anyway that I can print it out?<br clear="all" /><br />Best
Regards,<br/> Zhe HE<br />TEL: (001) 646-789-3008<br />Address:965 Amsterdam Avenue,  <br />New York, NY 10025<br /><br
/>MasterStudent, CS Dept.<br />Columbia University <br /><a
href="http://www.columbia.edu/~zh2132">www.columbia.edu/~zh2132</a><br/> -------------------------------------------<br
/>07Alumni<br />Bachelor of Eng, BUPT <br /><a href="http://www.bupt.edu.cn">www.bupt.edu.cn</a><br /> 

Re: Get Date value from Datum

От
imad
Дата:
What do you want to print? The integer value or the date string like
"29-01-2008". Use the date_out function to convert your value to date.

--Imad

On Tue, Nov 4, 2008 at 10:19 AM, Zhe He <henryhezhe2003@gmail.com> wrote:
> Hi,
> I met some problem with get date type value
> from a table. I have a Datum which stores this
> value as an integer and I want to get its date
> value. Is there anyway that I can print it out?
>
> Best Regards,
> Zhe HE
> TEL: (001) 646-789-3008
> Address:965 Amsterdam Avenue,
> New York, NY 10025
>
> Master Student, CS Dept.
> Columbia University
> www.columbia.edu/~zh2132
> -------------------------------------------
> 07 Alumni
> Bachelor of Eng, BUPT
> www.bupt.edu.cn
>


Re: Get Date value from Datum

От
"Hannes Eder"
Дата:
On Tue, Nov 4, 2008 at 12:30 AM, imad <immaad@gmail.com> wrote:
> What do you want to print? The integer value or the date string like
> "29-01-2008". Use the date_out function to convert your value to date.
>
> --Imad
>
> On Tue, Nov 4, 2008 at 10:19 AM, Zhe He <henryhezhe2003@gmail.com> wrote:
>> Hi,
>> I met some problem with get date type value
>> from a table. I have a Datum which stores this
>> value as an integer and I want to get its date
>> value. Is there anyway that I can print it out?

Maybe inspecting the code of debugtup also helps, see

src/backend/access/common/printtup.c

(http://git.postgresql.org/?p=postgresql.git;a=blob;f=src/backend/access/common/printtup.c#l504)

--Hannes