To format a date in java
Calendar cal = Calendar.getInstance();
String myDate = new SimpleDateFormat("ddMMMyyyy").format(cal.getTime());
Similarly we can use a string to convert to Date
Date myOtherDate = new SimpleDateFormat("ddMMMyyyy").parse(dateString);
No comments:
Post a Comment