• Post Reply Bookmark Topic Watch Topic
  • New Topic

Convert String to Time  RSS feed

 
Amruta Jegarkal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i convert String to exactly java.sql.Time
 
Stephan van Hulst
Saloon Keeper
Posts: 7821
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you can see from the JavaDoc, you can construct java.sql.Time from a millisecond time stamp. So you need to parse your String to milliseconds. Use SimpleDateFormat.parse(String) to get a Date instance, on which you can then call getTime().
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!