Hi,
I may have found the explanation and I can try to give an answer.
To be confirmed though 
The ms seem to be archived well but on the other hand the datetime type in MariaDB does not contain the milliseconds!
The precision of datetime depends on the SQL base
Must modify the format in the table:
Checking the result after the ALTER TABLE
:
With mysql:
[quote]MariaDB [tdb]> SELECT DATE_FORMAT(time, ‘%Y-%m-%d %H:%i:%s.%f’) FROM att_00181 WHERE time LIKE ‘2024-07-18 00:00:00%’;
±------------------------------------------+
| DATE_FORMAT(time, ‘%Y-%m-%d %H:%i:%s.%f’) |
±------------------------------------------+
| 2024-07-18 00:00:00.061000 |
| 2024-07-18 00:00:00.161000 |
| 2024-07-18 00:00:00.261000 |
| 2024-07-18 00:00:00.360000 |
| 2024-07-18 00:00:00.461000 |
| 2024-07-18 00:00:00.610000 |
| 2024-07-18 00:00:00.711000 |
| 2024-07-18 00:00:00.811000 |
| 2024-07-18 00:00:00.911000 |
±------------------------------------------+
9 rows in set (7.88 sec)
MariaDB [tdb]> SELECT * FROM att_00181 WHERE ((time >= ‘2024:07:18 00:00:00.000’) AND (time <= ‘2024:07:18 00:00:05.000’));
±------------------------±----------------------+
| time | value |
±------------------------±----------------------+
| 2024-07-18 00:00:00.061 | 0.010256410576403141 |
| 2024-07-18 00:00:00.161 | 0.010256410576403141 |
| 2024-07-18 00:00:00.261 | 0.010256410576403141 |
| 2024-07-18 00:00:00.360 | 0.0068376073613762856 |
…
| 2024-07-18 00:00:04.811 | 0.008547008968889713 |
| 2024-07-18 00:00:04.910 | 0.008547008968889713 |
±------------------------±----------------------+
46 rows in set (6.99 sec)
[/quote]
With the use of TdbExtractor:
[quote][datetime.datetime(2024, 7, 18, 0, 0, 0, 61000)
datetime.datetime(2024, 7, 18, 0, 0, 0, 161000)
datetime.datetime(2024, 7, 18, 0, 0, 0, 261000)
datetime.datetime(2024, 7, 18, 0, 0, 0, 360000)
…
datetime.datetime(2024, 7, 18, 0, 0, 4, 811000)
datetime.datetime(2024, 7, 18, 0, 0, 4, 910000)][/quote]