1

I'm using QuickFIX/C++ and I want to convert MDEntryTime field, which is UtcTimeOnly object, to milliseconds.

FIX::UtcTimeOnly to;
std::cout <<static_cast<unsigned long>(to.getTimeT());

this gives incorrect values. This same approach works work UtcTimeStamp objects.

what's wrong with it?

xyzt
  • 1,201
  • 4
  • 18
  • 44

1 Answers1

0

From the documentation it looks like:

to.getTimeT() * 1000 + to.getMillisecond()

Should work. It will return incorrect values if you are on an ancient compiler with 32-bit time_t though.

Alan Birtles
  • 32,622
  • 4
  • 31
  • 60
  • Is there a question? Perhaps https://stackoverflow.com/questions/2467418/portable-way-to-deal-with-64-32-bit-time-t will help? – JimmyNJ Aug 16 '19 at 18:54