milliseconds...
C++ library for creating XLSX files for MS Excel 2007 and above.
Brought to you by:
oxod,
programmeralex
I found that there are big difficulties to store time with millisecnds precision. time_t dont store ms at all, when I tried doubles , sometimes values were rounded even to few minutes.
I have proposition to make kind of hack: if string started from some unprintable char, like 0x01 or 0x21, string can be added as raw value, without quotation. In this case it may be easy to add cell preformated date-time like 1990-12-12 12:12:12.075 or double with desired precision.
Thanks for the info. I'll think about it. It may be sufficient to modify the CellDataTime class and there will be no need for hacking :-)
I modified the library, a new version in the attachment. I will be glad to any feedback from you.
Please see this example.
Looks like it works.
But I have proposition: to add also call of CellDataTime with paramter, compatible with WinApi SYSTEMTIME. SYSTEMTIME is defined as
WORD is uint16_t.
Such call looks more short and convinuent, at least for Windows users .
Your proposition is good, I added such functionality.
I also added the ability to use the QDateTime class from the Qt framework.
The attachment has an updated example.
Please pay attention to the generated xlsx-file in the section "Direct date and time".
If the time specified is accurate to milliseconds, and the style is selected without milliseconds, then Excel rounds the milliseconds to the nearest second.
I think this can be confusing for users.
Thanks!
Looks like SYSTEMTIME work as well!
Thank you for your ideas and testing :-)