Forex Tester Forum (Professional Training Software for Traders) Forum Index Forex Tester Forum (Professional Training Software for Traders)

Back to main site   Risk disclosure
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

HowTo: Delphi TDateTime conversion into C++ time

 
Post new topic   Reply to topic    Forex Tester Forum (Professional Training Software for Traders) Forum Index -> FT API
View previous topic :: View next topic  
Author Message
Wessel



Joined: 12 Oct 2010
Posts: 57

PostPosted: Wed Feb 16, 2011 10:45 pm    Post subject: HowTo: Delphi TDateTime conversion into C++ time Reply with quote

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
Back to top
View user's profile Send private message
FT Support



Joined: 11 Jul 2009
Posts: 901

PostPosted: Thu Feb 17, 2011 7:09 pm    Post subject: Reply with quote

Wessel, Thank you for posting this!
_________________
Check our other products here:
www.fx-metropolis.com
www.forexcopier.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Forex Tester Forum (Professional Training Software for Traders) Forum Index -> FT API All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group