Обсуждение: timestamp,bool,date with PQgetvalue

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

timestamp,bool,date with PQgetvalue

От
Raghu Bhai Chalasani
Дата:
Hi,
I am trying to get the Timestamp in const char * format with PQgetvalue
but I am unsuccesful in doing that. When I did:
string timestamps = PQgetvalue(...);
string dates = PQgetvalue(...);
string bools = PQgetvalue(...);
cout << "TimeStamp: " << timestamps << endl;
cout << "Date: " << dates << endl;
cout << "Bool: " << bools << endl;
I am getting some junk value. I have looked at all the manuals online and
searched on internet but couldn't find anything.
I want the 'timestamps' or 'dates' or 'bools' to have the string format as
in database... so if the database has
update_timestamp                   date                  bool
-------------------------------------------------------------
02/28/2001 19:43:22.00 EST|   02/28/2001             | t                                 

I want:
'timestamps' = '02/28/2001 19:43:22.00 EST';
'dates'      = '02/28/2001';
'bools'      = 't';
How can I do that?
Can someone please shed some light on me about it? :-)
Thanks,
Raghu Chalasani