datetime firstdate = Time[10];
The datetime data type is a lot like a ulong value. It stores the number of seconds since the epoch.
Read more here:
The datetime data time is a lot like a ulong value. It stores the number of seconds since the epoch.
Read more here:
thanks for you
Anthony Garot....
i will take a look
regard
Try
Time[i] is not a string.
andrew4789 Keith Watford thanks for your comments..
the problem was solved for me as the main goal is to import the date time value of a specific bar to an excel sheet
but because am not a programmer i used the wrong function
int
but Anthony Garot gave me the correct function
datetime
which i found helpfull ...in showing the date time on the chart
and then to convert it to string in order to export it to an excel sheet
string l_time2str_10 = TimeToStr(iTime(NULL,0, 10), TIME_DATE|TIME_MINUTES); sName=Symbol()+Period()+".csv"; // int FileDelete(sName); int file =FileOpen(sName,FILE_CSV|FILE_WRITE,","); if (file < 1) { Print("can not open file. error-" + GetLastError()); return; } FileWrite(file, l_time2str_24 ); } FileClose(file);
thanks again

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi...i have a code to find the date and time for specific bar and show them on the chart
this code is ok...but i want to use the value that i got from the above code to make some calculation...
if it was an integer i can use the function
so i can use it in another formula or even export the value of (firstdate)
to an excel file
but that dont work and i have only the year value eg...2018
any help is appreciated