java - cast a String to sql time -
how cast string time type mysql in java string------->java.sql.time
thanks.
it depends entirely on format of string, use simpledateformat parse string java.util.date; can extract millisecond time value date , pass java.sql.time(). this:
string s = /* date string here */; simpledateformat sdf = new simpledateformat(/* date format string here */); long ms = sdf.parse(s).gettime(); time t = new time(ms);
Comments
Post a Comment