timestamp, date and bool with PQgetvalue...

From: Raghu Bhai Chalasani <chalasar(at)wam(dot)umd(dot)edu>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: timestamp, date and bool with PQgetvalue...
Date: 2001-03-01 01:34:22
Message-ID: Pine.GSO.4.21.0102282028210.887-100000@rac3.wam.umd.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Browse pgsql-interfaces by date

  From Date Subject
Next Message Raghu Bhai Chalasani 2001-03-01 01:38:53 timestamp,bool,date with PQgetvalue
Previous Message aong 2001-02-28 23:57:50 pgaccess