ADK Packed date is creating "Invalid Datetime" message in AFL

Hi

I'm developing a DLL to import intraday tick data and would like to encode timestamps that would look like this to AmiDate.

2018-02-27 00:01:04.5803

I've looked at the ADK sample but I can' figure out what to do with the seconds and milliseconds (04.5803). I'm following this convention:

			int datenum = atoi( strtok( line, "," ) );	// YYMMDD
			int timenum = atoi( strtok( NULL, "," ) );	// HHMM

			qt->DateTime.PackDate.Tick = 0;
			qt->DateTime.PackDate.Minute = timenum % 100;
			qt->DateTime.PackDate.Hour = timenum / 100;
			qt->DateTime.PackDate.Year = 100 + datenum / 10000;
			qt->DateTime.PackDate.Month = ( datenum / 100 ) % 100;
			qt->DateTime.PackDate.Day = datenum % 100;

How do I convert those?

Thanks.

SethMo

1 Like
  1. Your "year" field is incorrect.
  2. Download CURRENT ADK
  3. Then you will find NEW structure 64-bit datetime that holds milliseconds and you should use that and normal year, like 2018.