import java.text.*;
import java.util.*;public class dformat {
public static void main (String a[]){
try {
/*
** we specify Locale.US since months are in english
** we want to parse a TimeStamp
*/
SimpleDateFormat sdf = new SimpleDateFormat
("dd-MMM-yyyy HH:mm:ss", Locale.US);
/*
** fix timezone in the SimpleDateFormat
** bug in JDK1.1
*/
sdf.setCalendar(Calendar.getInstance());
/*
** create a Date (no choice, parse returns a Date object)
*/
Date d = sdf.parse("24-Feb-1998 17:39:35");
System.out.println(d.toString());
/*
** create a GregorianCalendar from a Date object
*/
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(d);
System.out.println(gc.getTime().toString());
}
catch (Exception e) {
e.printStackTrace();
}
}
}
import java.util.*;public class dformat {
public static void main (String a[]){
try {
/*
** we specify Locale.US since months are in english
** we want to parse a TimeStamp
*/
SimpleDateFormat sdf = new SimpleDateFormat
("dd-MMM-yyyy HH:mm:ss", Locale.US);
/*
** fix timezone in the SimpleDateFormat
** bug in JDK1.1
*/
sdf.setCalendar(Calendar.getInstance());
/*
** create a Date (no choice, parse returns a Date object)
*/
Date d = sdf.parse("24-Feb-1998 17:39:35");
System.out.println(d.toString());
/*
** create a GregorianCalendar from a Date object
*/
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(d);
System.out.println(gc.getTime().toString());
}
catch (Exception e) {
e.printStackTrace();
}
}
}
String dateformat='YYYY-MM-DD HH24:MI:SS';
..to_date(date , dateformat)..;