To get the milliseconds from a LocalDateTime object in Java 8, you can use the toInstant method and the toEpochMilli method.