|
can anyone help me with this?
hi i was wondering if anyone could help me out with the answer to this??!? thanks people
There is a standard class called DateFormat which (among other things) lets you convert dates to various different output formats. It has a subclass SimpleDateFormat which you may also use).
Use it to write a method called convert which returns a String in the form dd-mmm-yyyy: when passed a GregorianCalendar with a specific date
public String convert (Calendar gc) {
...
}
For example, when myGC is a GregorianCalendar variable representing the 25th of December 2006,
String s = convert(myGC);
should set s to the string "25-Dec-2006".
Enter your answer (just your convert method) below:
|