Here you can find the source of toTime(LocalTime localTime)
public static Time toTime(LocalTime localTime)
//package com.java2s; //License from project: Apache License import java.sql.Time; import java.time.LocalDate; import java.time.LocalTime; import java.time.ZoneOffset; import java.time.ZonedDateTime; public class Main { public static Time toTime(LocalTime localTime) { if (localTime == null) { return null; }/*from w w w .j a v a 2 s .c o m*/ return new Time( Time.from(ZonedDateTime.of(LocalDate.now(), localTime, ZoneOffset.systemDefault()).toInstant()) .getTime()); } }