Java SQL Time convert to LocalTime

Description

Java SQL Time convert to LocalTime

import java.sql.Time;
import java.time.LocalTime;


public class Main {
  public static void main(String[] args) {
     Time time = Time.valueOf("17:00:00");
     System.out.println("time:"+time);
     //from   www .j a va 2s.  c  o  m
     LocalTime localTime = time.toLocalTime();
     System.out.println("local time:"+localTime);
     

  }
}



PreviousNext

Related