Hello,
DaysSince1900 is one way, the other is DateTimeDiff available
if you are using recent versions you can use
DateTimeDiff function that calculates distance in seconds between two
datetime values.
You can divide the value returned by DateTimeDiff by (24*60*60*365.25)
to get distance in years.
(365.25 days per year factor includes leap years every four year and is
accurate enough for one century).
Best regards,
Tomasz Janeczko
amibroker.com
On 2009-12-10 14:47, wavemechanic wrote:
*To be precise you have to be precise and how you do that is up to
you. However, you should ask yourself what precision do you really
need. No sense going overboard for the "tenth" decimal place if you
don't need it.*
----- Original Message -----
*From:* Markus Witzler <mailto:[email protected]>
*To:* [email protected] <mailto:[email protected]>
*Sent:* December 08, 2009 4:13 PM
*Subject:* Re: [amibroker] Time between two dates
Hi wavemechanic,
I considered DaysSince1900 (). But do I change the result back
into years, especially when there is a leap year in between?
Just by dividing by 365 wouldn´t then be correct, right?
I guess one would need to write a function for this...?
Thanks
Markus
----- Original Message -----
*From:* wavemechanic <mailto:[email protected]>
*To:* [email protected]
<mailto:[email protected]>
*Sent:* Monday, December 07, 2009 2:19 AM
*Subject:* Re: [amibroker] Time between two dates
*Take a look at DaysSince1900()*
----- Original Message -----
*From:* Markus Witzler <mailto:[email protected]>
*To:* [email protected]
<mailto:[email protected]>
*Sent:* December 06, 2009 3:53 PM
*Subject:* [amibroker] Time between two dates
Hello,
could someone tell me how to compute the number of days
beetween two dates?
The result should be expressed in years, for instance
23.25 years.
I thought of using datenum but got stuck...
Thanks
Markus
__________ Information from ESET Smart Security, version
of virus signature database 4665 (20091206) __________
The message was checked by ESET Smart Security.
http://www.eset.com <http://www.eset.com>
__________ Information from ESET Smart Security, version of
virus signature database 4668 (20091207) __________
The message was checked by ESET Smart Security.
http://www.eset.com