Need faster replacement for COleDateTime::Format()
I have an app which manipulates a lot of dates (reading from a database).
It uses the Format() member function of COleDateTime extensively.
During a recent profiling session, it became apparent that a large amount of my app's time is spent in the Format() function.
Here's how I'm using it:
Code:
COleDateTime date1 = x.Format("%m/%d/%Y");
Simple, yes. But very expensive in terms of CPU time.
Does anyone have a faster way to do this?
Oops, I realized I wrote my post wrong
should have been:
I have an app which manipulates a lot of dates (reading from a database).
It uses the Format() member function of COleDateTime extensively.
During a recent profiling session, it became apparent that a large amount of my app's time is spent in the Format() function.
Here's how I'm using it:
Code:
CString date1 = x.Format("%m/%d/%Y");
(x is a COleDateTime variable)
Simple, yes. But very expensive in terms of CPU time.
Does anyone have a faster way to do this?
I probably didn't explain correctly
For this discussion, let's forget that the values are in a database.
I still have to do a lot of format()s outside of the database access stuff.
And the OLE DB library I use requires me to read dates as dates, not as strings.