Java SQL Time convert to Instant

Description

Java SQL Time convert to Instant

import java.sql.Time;
import java.time.Instant;


public class Main {
  public static void main(String[] args) {
     Time time = Time.valueOf("17:00:00");
     System.out.println("time:"+time);
     /*from ww w .  jav  a 2s  .co  m*/
     Instant ins = time.toInstant();
     System.out.println("ins:"+ins);
     

  }
}



PreviousNext

Related