In case of LocalDate, you can use the toEpochDay()toEpochDay() method. It returns the number of days since 01/01/1970. That number then can be easily converted to milliseconds:
long dateInMillis = TimeUnit.DAYS.toMillis(myLocalDate.toEpochDaystoEpochDay()); Documentation can be found here.
In case of LocalDateTime, you can use the toEpochSecond()toEpochSecond() method. It returns the number of seconds since 01/01/1970. That number then can be converted to milliseconds, too:
long dateTimeInMillis = TimeUnit.SECONDS.toMillis(myLocalDateTime.toEpochSecondstoEpochSecond()); Documentation for that is here.