Java SQL Time strToTime(String strDate)

Here you can find the source of strToTime(String strDate)

Description

str To Time

License

Open Source License

Declaration

public static java.sql.Time strToTime(String strDate) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

public class Main {

    public static java.sql.Time strToTime(String strDate) {
        String str = strDate;/*from w  w w  .jav  a 2 s.co m*/
        SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
        java.util.Date d = null;
        try {
            d = format.parse(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        java.sql.Time time = new java.sql.Time(d.getTime());
        return time.valueOf(str);
    }
}

Related

  1. setTime(PreparedStatement statement, int index, Date value)
  2. sqlDateTimeAdd(java.util.Date date, long milliseconds)
  3. sqlTime()
  4. str2dateTime(String handedate)
  5. StrToDateTime(String val)
  6. toDate(TimeZone tz, int days)
  7. toDateFromTime(String time)
  8. todayBeginTime()
  9. toGMTTime(long local)