-6

Is there any Java Library or class that makes it easy to work with MySQL datetime fields?

For example, something that will take a string in MySQL Date format, and return a Java date object?

If not, is it better to store dates/times in a format other than MySQL datetime, to make it easier to work with them in Java?

Ali
  • 261,656
  • 265
  • 575
  • 769

1 Answers1

1

I would suggest that you use the SimpleDateFormat class. You will need to work out how the date is stored in MySQL and accordingly use the pattern.

Please read http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html for details.