[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Exporting dates in JS



PureBytes Links

Trading Reference Links

Tomasz,

I'll add this to the script and finish testing. 

Thanks.

In a message dated 9/26/01 2:54:10 PM Eastern Daylight Time, amibroker@xxxx 
writes:

> Unfortunatelly JScript does not provide a nice way
> to format strings like printf() in C/C++.
> 
> But you can write a function to format dates:
> 
> function FormatDate( d )
> {
> year = d.getFullYear();
> month = d.getMonth() + 1;
> day = d.getDate();
> 
> yearstr = String( year );
> monthstr = ( month <= 9 ? "0" : "" ) + String( month );
> daystr = ( day <= 9 ? "0" : "" ) + String( day );
> 
> return yearstr + monthstr + daystr;
> }
> 
> and then use it here:
> f.WriteLine( oStock.Ticker + "," +
> FormatDate( oDate ) + "," +
> FormatFloat( oQuote.Open ) + "," +
> ....
>