After browsing through the ADK documentaion, I have found more than one way to obtain dates and they are enumerated here. Ideally I want one function that returns me date value that is comparable wtih one another and code is not cumbersome to use / debug. These are following approaches tried
Approach one: Use gSite.GetDateTimeArray
unsigned long long *dateArray = gSite.GetDateTimeArray();
The values that I get are typically like 19 digit numbers but I am unable to find any documentation on how to use them. They seem comparable, but are they?
9090133071771992064 supposedly represents 13:14 on 19 June 2018 but how to translate this back and forth.
This had seemed to be the most promising approach but stumped for my inability to find proper documentation
Approach two: Use gSite.CallFunction and retrieve values of built in AFL function, DateTime
Amivar dateTimeArray = gSite.CallFunction("DateTime", 0, NULL);
Again values returned are typically 19 digit numbers and I did find article about how amibroker fits datetime in 4 bytes whereas Microsoft took 8 bytes.
Put this approach to rest after the DateTime documentation clearly says that this values are not directly comparable and one is meant to use DateTimeDiff function
Approach three: Use gSite.CallFunction and retrieve values of built in AFL function, DateNum and TimeNum.
Discounting the absence of century in datenum, this is by far the easiest approach
Approach four: Use gSite.CallFunction and retrieve values of built in AFL function, Year, Month, Day, Hour, Minute, Second ... etc....
This approach works OK but it is cumbersome (and definitely slow) to compare two sets of date.
One another anomaly that I noticed is that array holding Seconds often contain values other than zero. Chart time frame (and database resolution) both are 1 minute. Could this be reason for Seconds array to have inappropriate values?