Обсуждение: Newbie Q: How to deal with date/time with libpq or ecpg?

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

Newbie Q: How to deal with date/time with libpq or ecpg?

От
"Michael Zhang"
Дата:
Hi, I am new to the postgreSQL.

I would like to set up my own WWW server using linux/postgreSQL. Some of

my web applications use many date/time manipulations. For example, I
would like to dynamicly display a date of birth column with specified
format. I could do it on Oracle like this:
    SELECT to_char(DateofBirth, 'MM-DD-YYYY') from Employee_tbl where
First_nm = 'Mike';
Then I could use Pro*C to retrive the result into a char[] array.

But how can I receiver this kind of information with specified format in

postgreSQL by using libpq or ecpg?

Thanks in advance!
Mike


Re: [INTERFACES] Newbie Q: How to deal with date/time with libpq or ecpg?

От
Michael Meskes
Дата:
On Wed, Feb 24, 1999 at 10:38:42AM -0500, Michael Zhang wrote:
> my web applications use many date/time manipulations. For example, I
> would like to dynamicly display a date of birth column with specified
> format. I could do it on Oracle like this:

I'm not sure about format changing but libpq returns all data as string and
ecpg does put it into a char array without a problem.

I attach an example.

Michael
--
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael.Meskes@gmx.net          | Use PostgreSQL!

Вложения