DaZuiZui commented on issue #19264:
URL: https://github.com/apache/iotdb/issues/19264#issuecomment-6858042194

   Thanks for the detailed report. The main issue is confirmed and fixed in 
#19267: `convertToTimestamp` counted the intra-second milliseconds twice, and 
`date_bin(1mo, time, 500)` now returns `500` / `2678400500` instead of `1000` / 
`2678401000`.
   
   One correction on the note at the end: the negative-timestamp 
`DateTimeException` in `convertToLocalDateTime` does not reproduce. 
`Instant.ofEpochSecond` accepts a negative nano adjustment and normalizes it, 
so the old code already returns the right instant for negative timestamps that 
are not an exact second:
   
   ```
   us -500000  old -> 1969-12-31T23:59:59.500Z   (expected 
1969-12-31T23:59:59.500Z)
   us -1500000 old -> 1969-12-31T23:59:58.500Z   (expected 
1969-12-31T23:59:58.500Z)
   us -1       old -> 1969-12-31T23:59:59.999999Z (expected 
1969-12-31T23:59:59.999999Z)
   ```
   
   So the PR only changes `convertToTimestamp`. A `floorDiv`/`floorMod` rewrite 
there would not change any result, so it is left out.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to