@Ankur, so you don’t want to convert to type DateNum all of the sudden?
Fine. But then you would have to change your topic.
@PortfolioBuilder, he is already using StrToDateTime in his first post. All he has to do is converting to DateNum via DateTimeConvert but apparently either I’m talking Martian or he is trying to argue with oldtimers.
It is important to understand that DateTime is not a simple number but rather bitset
The mistake you are doing is assuming that datetime is a “normal” number. It is not. It is encoded value (opaque to human) because there is NOT enough space to encode date time WITH second resolution inside 32-bit number. So AmiBroker uses heavy magic here to make it possible and these are not normal numbers. They are packed bitfields that would produce weird values if displayed as numbers.
The ONLY way to display human-readable value from datetime field is to use DateTimeToStr(). This function knows how to convert datetime to human-readable.
Do NOT hijack threads. Keep strictly on topic. Microsec() and Millisec() functions ARE available that provide finer granularity (if your data vendor sends that - most don’t) but this is OFF-TOPIC with regards to this thread.
Thread is closed.