formatter = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy");
date = formatter.parse(aDate);
java.sql.Date sqlDate = new java.sql.Date(date.getTime());
oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);
If you want the date to be locale specific, use the following
formatter = new SimpleDateFormat(pattern, currentLocale);
Here are some customized Date and Time formats (from Oracle Site)
Pattern | Output |
---|---|
dd.MM.yy | 30.06.09 |
yyyy.MM.dd G 'at' hh:mm:ss z | 2009.06.30 AD at 08:29:36 PDT |
EEE, MMM d, ''yy | Tue, Jun 30, '09 |
h:mm a | 8:29 PM |
H:mm | 8:29 |
H:mm:ss:SSS | 8:28:36:249 |
K:mm a,z | 8:29 AM,PDT |
yyyy.MMMMM.dd GGG hh:mm aaa | 2009.June.30 AD 08:29 AM |