| View previous topic :: View next topic |
| Author |
Message |
Terranin Site Admin

Joined: 21 Oct 2006 Posts: 831
|
Posted: Mon Apr 28, 2008 5:39 pm Post subject: How to work with time |
|
|
ForexTester uses Borland Delphi time format for its functions like Time(), iTime() and others. So, if you use C++ compilers you should convert this time to C++ format.
Delphi format (TDateTime):
Delphi TDateTime is equals to double value. The integral part of a Delphi TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of the TDateTime value is fraction of a 24 hour day that has elapsed.
Following are some examples of TDateTime values and their corresponding dates and times:
0 12/30/1899 12:00 am
2.75 1/1/1900 6:00 pm
-1.25 12/29/1899 6:00 am
35065 1/1/1996 12:00 am
C++ format (Unix format):
C++ time is an integer value that shows how many seconds passed sinse 01/01/1970.
Converting functions:
| Code: | unsigned int UnixStartDate = 25569;
unsigned int DateTimeToUnix(double ConvDate)
{
return((unsigned int)((ConvDate - UnixStartDate) * 86400.0));
}
double UnixToDateTime(unsigned int USec)
{
return((Usec/86400.0) + UnixStartDate);
} |
_________________ Hasta la vista
Mike |
|
| Back to top |
|
 |
hjalamo
Joined: 01 Aug 2010 Posts: 1
|
Posted: Wed Nov 24, 2010 6:13 am Post subject: time and itime function with c++ |
|
|
Please.
I need developer a strategy that it will entry at 00:00
I have tried with "time, timeframe, itime (c++)" but i have got problems.
can you help me how to develop this code sentence?
Thanks.
Best Regards,
Humberto Álamo. |
|
| Back to top |
|
 |
FT Support
Joined: 11 Jul 2009 Posts: 902
|
|
| Back to top |
|
 |
|