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

Re: Converting Military Time to Normal time, heres how!



PureBytes Links

Trading Reference Links

OR.....

If the time shown is less than 12, its "human" time.
If the time shown is greater than 12, subtract 12.

FOR AM or PM...

Look out a window.

(Sorry, Ian, its early here - 0730 hours; I just HAD to "do it".  Haven't
had coffee yet.).

----- Original Message -----
From: "Ian McVicar" <icm63@xxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Wednesday, December 13, 2000 11:42 PM
Subject: Converting Military Time to Normal time, heres how!


> Thought I might help some one, hey you never know !!!
>
> Are you fed up of reading miltary time when looking at text on charts or
> text in the message log,
> that have been created from your EL programs.
>
> To convert miltary time to exchange time shown by the chart scale.(If your
> charts are setup as local time, you
> may have to fiddle with the calculations to suit).
>
> Open a new function in Power editor,
> Name it as : ChartTime   {name of your function is important for code
line
> marked  "XX" }
> Select output as : "text"
>
> Input this code :
> ********************************************************
> Inputs: NormTime(NumericSimple);
>
> Vars : AdjTime("0");
>
> If NormTime < 1000 then
> AdjTime = Leftstr(numtostr(NormTime,0),1)+":"+
> rightstr(numtostr(NormTime,0),2);
>
> If NormTime > 959 and NormTime < 1300 then
> AdjTime = Leftstr(numtostr(NormTime,0),2)+":"+ rightstr(numtostr(NormTime
> ,0),2);
>
> If NormTime > 1259 then
> AdjTime = Leftstr(numtostr(NormTime - 1200,0),1)+":"+
> rightstr(numtostr(NormTime - 1200,0),2);
>
> ChartTime = AdjTime; {XX}
>
> ****************************************************************
>
> Thus reading time as 1421 will be 2:21, or 0845 will be 8:45
>
> In Your indicator code when creating the text time to output.
>
> Instead of  :
>
> Numtostr(time,0) {when time is 1421}
>
> Result : 1421 {in text format}
>
> Do : Charttime(time)
>
> Result : 2.21 {in text format}
>
> Thats it , hope it helps someone.
>
> Ian
>
>
>
>
>
>
>
>
>
>