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

[amibroker] Re: DateTime calculations - internal format of dates/days?



PureBytes Links

Trading Reference Links

Thanks Graham - but are you referring to the language/region 
settings of date formats in windows? If so, how can I use this to 
calculate the number of days between two datetime numbers? Let me 
try to illustrate in an example afl:

Day1Str= "2001-12-31";
Day2Str= "2002-02-01";
Day1Num = StrToDateTime(Day1Str);
Day2Num = StrToDateTime(Day2Str);
_TRACE(Day1Str+" = "+NumToStr(Day1Num));
_TRACE(Day2Str+" = "+NumToStr(Day2Num));

will show the result:

2001-12-31 = 122781519547411520000000.000
2002-02-01 = 190075232921104710000000.000

But how can i deduct a "date number" from this internal format so I 
can calculate the difference in days between day1 and day2? So far, 
I've not found any internal afl functions that will help me do this.

Best regards

Jens Tiedemann


--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
>
> In accordance with your windows default format
> 
> -- 
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
> 
> 
> On 28/05/06, tiedemj <home@xxx> wrote:
> > What is the internal format of dates/days in DateTime() numbers. 
How
> > are years, months and days represented. Don't need time formats 
right
> > now, as I need to calculate the days between two DateTime() 
numbers.
> > Anybody out there who knows how to do it?
> >
> > Best regards
> >
> > Jens Tiedemann
> >
> >
> >
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Everything you need is one click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/