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

Re: Reading computer time with VBScript...Need Help



PureBytes Links

Trading Reference Links

The following script works. thanks Dingo

EnableScript("vbscript");
<%
Afl("tradetime")=Csng(Hour(time) + Minute(time) / 60)
%>
goldfreaz@xxxx

--- In amibroker@xxxx, "goldfreaz" <goldfreaz@xxxx> wrote:
> I cannot seem to get the computer time into Amibroker. Please help 
> with the script below. It works in VB, but not as a script. The 
> format statement does not seem to be allowed in script.
> 
> I want the time of day in military time in hours plus decimal 
minutes.
> 
> 
> EnableScript("vbscript");
> <%
> 
> x = Format(time, "h:m")
> pos = InStr(x, ":")
> length = Len(x)
> hh = Left(x, pos - 1)
> mm = Right(x, length - pos)
> afl.var("tradetime")= Csng(hh + mm / 60)
> %>