Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date format

 
Milind Deodhar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a frame which has a textbox , the values of which should be date and should update a date in a MS Access Database.
The date in the Access database is of Date/Time type with Short Date format.
How should I convert the string to date format which can be inserted in the database.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are some methods you can use in the java.text.DateFormat class.

Bosun
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use SimpleDateFormat with the pattern using "MM/dd/yy"
SimpleDateFormat myDate = new SimpleDateFormat("MM/dd/yy");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic