Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading Dates from ADO

Status
Not open for further replies.

MattWoberts

Programmer
Oct 12, 2001
156
GB
Hi,

I have an ADO Recordset that contains a date. I need to copy the date to a string, and then do some formatting... easy enough, but how do I know the date format. Depending on the PC setup, the date can be formatted dd/mm/yy or mm/dd/yy.....is there a way I can deal with this and convert whatever is in the recordset to dd/mm/yy???

Thanks

Mattwoberts
 
As far as I know, the date stored in the recordset is of type Variant(VT_DATE). If you want to keep it in a form you can work with in C++ and be able to put it back into a database as a Variant(VT_DATE), put it into a COleDateTime variable. I think one of the class members of COleDateTime might have what you are looking for.
 
Thanks, but I am using ATL - not MFC, so I dont have access to those handy classses :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top