Question : Date-time for

 
How do I retrieve the date-time for a specified bar? I looked at the date-time functions but couldn't find an answer or I probably overlooked.


For example, in the following sample code, I am trying to write the date, open, high, low and close to a file. How do I find the date of the bar being used ?

....

int nCurrBar = Bars;
while (nCurrBar > 0 )
{
// Print the Date of the nCurrBar.

FileWrite(hFile, **date of nCurrBar**, Open[nCurrBar], High[nCurrBar], Low[nCurrBar], Close[nCurrBar] );


nCurrBar--;
}



Thanks in advance,
Adheer.
 
TimeToStr(Time(nCurrBar));
Reason: