GetFnData("ExDividendDate") returns strange number

Hello, I'm unable to get ex dividend date from my exploration. I enclose simple code and results.

Filter = 1;
AddTextColumn(FullName(),"Full Name",1.2);
AddColumn(C,"Close",1.2);
AddColumn(GetFnData("ExDividendDate"),"ExDividendDate");

Capture

Thanks for help.
Richard.

You have to insert formatDateTime or formatDateTimeISO to 3rd argument of AddColumn since ExDividendDate returns datetime!

Filter = 1;
AddTextColumn(FullName(),"Full Name",1.2);
AddColumn(C,"Close",1.2);
AddColumn(GetFnData("ExDividendDate"),"ExDividendDate", formatDateTime);

As for "... strange number"

VERSION 5.27 and above: It is important to understand that DateTime is not a simple number but rather bitset and two datetime values can only be reliably compared for equlity or inequality using == or != operators. Any other comparisions (less than/greater then) using normal operators > < can lead to wrong results, therefore to compare two datetime numbers you should use DateTimeDiff( arg1, arg2 ) which will return positive values if arg1 > arg2 and negative values if arg1 < arg2

https://www.amibroker.com/guide/afl/datetime.html

1 Like

Thank You very much. :grinning: