Re: [amibroker] [Code] Array of Date in "yyyymmdd" format, then array converted to String

 

Are you familiar with the option of FormatDateTimeISO?
I asked the same question to AmiBroker but was unable to get an answer that I found useful.
I wanted to use AddColumn which is different than what you want.
The FormatDateTimeISO was to be available with the beta version of AmiBroker.
Good luck.
Sorry I don't have a good answer for you.

On Sun, Jun 19, 2016 at 1:56 PM, meanomalist@yahoo.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

Friends,

For my requirement, I need to create an Array which holds the date in YYYYMMDD format and that array is then Converted to STRING.

I want two dates, one is Beginnig by the Range Marker and another one is Ending by the Range Marker.

Tried varies ways, but finding it challenging based on my AFL capabilities.

Dayarray= Day();
monarray = Month();
Yeararray = Year();

bi = BarIndex();

eb = Nz(EndValue( BarIndex()    ));
bb = Nz(BeginValue( BarIndex()    ))  ;

mon_two_digit = iif((strlen(numtostr(monarray))) == 1, "0"+monarray, monarray);
day_two_digit = iif((strlen(numtostr(dayarray))) == 1, "0"+dayarray, dayarray);

// Reason why I do above is, DAY() and MONTH() gives Single digit day / month for say day 5 / month 7 and so on. to have it as MM i am prefixing "0".

Begin_yyyymmdd  = Yeararray[bb]+dayarray[bb]+Dayarray[bb];
End_yyyymmdd  = Yeararray[eb]+dayarray[eb]+Dayarray[eb];

// Trying to Concatenate so make it as YYYYMMDD


Ofcourse the code is not working, am sure I am doing it the wrong way, there has to be a shorter and creative way to do it.

Any help Please?






--
Karl Bergerson (カール バーガーソン)

〒002-0857
 札幌市北区屯田7条11丁目10-10
電話 050-5809-7325 (Skype)

__._,_.___

Posted by: Karl Bergerson <karl.bergerson@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon