Create a java.sql.Time Object from java.util.Date in Java

Description

The following code shows how to create a java.sql.Time Object from java.util.Date.

Example


/*  w  w w  .  ja va2s .  co  m*/
import java.text.ParseException;
import java.util.Date;

public class Main {

  public static void main(String[] args) throws ParseException {

    new java.sql.Time(new Date().getTime());
  }
}




















Home »
  Java Tutorial »
    Date »




Date Get
Date Set
Date Format
Date Compare
Date Convert
Date Calculation
Date Parse
Timezone