79689466

Date: 2025-07-03 21:22:52
Score: 0.5
Natty:
Report link

The answer by M. Justin based on your own idea shows the beautiful solution to your question. I would take it without hesitation. However, you mentioned that it is wordy and that you want something briefer. So:

    LocalTime time = LocalTime.now();
    System.out.println(time);

    LocalTime inMillis = time.truncatedTo(ChronoUnit.MILLIS);
    LocalTime inTenths = inMillis.with(ChronoField.MILLI_OF_SECOND,
            inMillis.get(ChronoField.MILLI_OF_SECOND) / 100 * 100);
    System.out.println(inTenths);

Example output:

23:16:52.679457431
23:16:52.600
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Arki Silva