Is it possible to do format a date of type String using a date formatter? I want to store my Date and Time in the Event class as Strings so that I don't need to convert the Strings loaded from a MYSQL database (using the types DATE and TIME) back into Date types so they can be stored in new Event objects. MySQL only accepts DATE in the format of `YYYY-MM-DD` and TIME in the format of `HH:MM:SS` but i want these to be formatted differently when i go to print them out in my program. 

When i run this code i get an `Cannot format given Object as a Date at java.text.DateFormat.format(Unknown Source)` error. If i try using parse() it won't compile because it only accepts Dates.

Main class

```
public Main() {
   ArrayList<Event> events = new ArrayList<Event>();
   private SimpleDateFormat timeFormat = new SimpleDateFormat("HH:MM:SS");
   private SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-DD");

   //Stores current time and date
   Date date;
   Date time;
   String d = "";
   String t = "";           

   d= dateFormat.parse(date);
   t= timeFormat.parse(time);

   events.add(d, t);

   //Print out newly formatted date and time when loaded from mysql
   System.out.println(events.get(0).printDate());
   System.out.println(events.get(0).printTime());
}

```

Events class

```
public class Event {    
   private String date;
   private String time;

   public Event(String d, String t) {
      date = d;
      time = t;
   }

   public String printDate() {
       SimpleDateFormat format = new SimpleDateFormat("DD/MM/YYYY");
       String newDate = format.format(date);
       return newDate;
   }

   public String printTime() {
       SimpleDateFormat format = new SimpleDateFormat("HH:mm");
       String newTime = format.format(time);
       return newTime;
   }
}

```