Originally posted by RaviSingh Kumar:
i am converting JTextField value to Date datatype using SimpleDateFormatter("dd/mm/yyyy"). The output is given as:
Sun Jan 22 00:10:00 GMT+05:30 2006
But while inserting data into database, i want that the date should be in this form '22-Jan-2006'.
Can anyone give me suggestion to this.
For input, it's probably easiest to use JFormattedTextField:
Presuming you're using
JDBC to access the database, it's probably easiest to use a PreparedStatement and let the JDBC driver worry about conversion:
[edit: "dd/mm/yyyy" -> "dd/MM/yyyy" ('mm' is minute-in-hour, not month-in-year)]
[ February 12, 2008: Message edited by: Brian Cole ]