aspose file tools*
The moose likes Beginning Java and the fly likes Date format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Date format" Watch "Date format" New topic
Author

Date format

Milind Deodhar
Ranch Hand

Joined: Dec 06, 2000
Posts: 32
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

Joined: Nov 06, 2000
Posts: 1510
There are some methods you can use in the java.text.DateFormat class.

Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Use SimpleDateFormat with the pattern using "MM/dd/yy"
SimpleDateFormat myDate = new SimpleDateFormat("MM/dd/yy");


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Date format