Get the Current Timestamp as a java.sql.Time Object? : Date Time Timestamp « Database « Java Tutorial






public class MainClass {

  public static void main(String[] args) {

    java.util.Date today = new java.util.Date();
    System.out.println(new java.sql.Time(today.getTime())); 

  }

}








20.20.Date Time Timestamp
20.20.1.Working with Date, Time, and Timestamp in JDBC
20.20.2.Insert Date value
20.20.3.Get Date value from ResultSet
20.20.4.Insert TIME value
20.20.5.Get TIME value from ResultSet
20.20.6.Insert TIMESTAMP value
20.20.7.Get TIMESTAMP value from ResultSet
20.20.8.Get the Current Date as a java.util.Date Object
20.20.9.Creating java.sql.Date Using java.util.Date
20.20.10.Creating java.sql.Date Using java.util.Calendar
20.20.11.Creating java.sql.Date Using the java.sql.Date.valueOf() Method
20.20.12.Creating java.sql.Date Using GregorianCalendar
20.20.13.Getting a Timestamp Object Using java.util.Date
20.20.14.Getting a Timestamp Object Using System.currentTimeMillis()
20.20.15.Get the Current Timestamp as a java.sql.Time Object?
20.20.16.Convert a String Date Such as 2003/01/10 to a java.sql.Date Object?
20.20.17.Convert a Timestamp to Month-Day-Year
20.20.18.Get a Date Label from a java.sql.Timestamp Object
20.20.19.Convert a java.sql.Timestamp Object to a java.util.Date Object?
20.20.20.Make a java.sql.Timestamp Object for a Given Year, Month, Day, Hour
20.20.21.Get a Date for a Specific Time Zone
20.20.22.Returns a java.sql.Timestamp equal to the current time
20.20.23.Convert into java.sql.Time into java.util.Calendar