Wessel
Joined: 12 Oct 2010 Posts: 57
|
Posted: Wed Feb 16, 2011 10:45 pm Post subject: HowTo: Delphi TDateTime conversion into C++ time |
|
|
Hi,
For those people who like to decompose the TDateTime object as it is returned by Time and iTime into something useful in C++ use the following calls to convert this COledatetime object into something civil:
| Code: |
SYSTEMTIME mytime;
VariantTimeToSystemTime( iTime(symbol, timeFrame, iUp+1), &mytime);
|
Now mytime is a structure the details can be found here:
http://msdn.microsoft.com/en-us/library/ms724950%28v=vs.85%29.aspx
| Code: |
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME;
|
Hope this helps others to make the conversion, took me way to long to figure this out.
Wessel
Last edited by Wessel on Mon Feb 21, 2011 11:15 pm; edited 1 time in total |
|