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

Re: [amibroker] Time between two dates


  • Date: Wed, 16 Dec 2009 15:07:03 +0100
  • From: Tomasz Janeczko <groups@xxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Time between two dates

PureBytes Links

Trading Reference Links



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 -----
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 -----
Sent: Monday, December 07, 2009 2:19 AM
Subject: Re: [amibroker] Time between two dates

 

Take a look at DaysSince1900()
----- Original Message -----
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


__________ Information from ESET Smart Security, version of virus signature database 4668 (20091207) __________

The message was checked by ESET Smart Security.

http://www.eset.com


__._,_.___


**** 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/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___