Skip to content

Commit c779ea8

Browse files
committed
issue 20
1 parent e8d39e7 commit c779ea8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎koans/src/intermediate/AboutDates.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import java.text.DateFormat;
77
import java.text.ParseException;
8+
import java.text.SimpleDateFormat;
89
import java.util.Calendar;
910
import java.util.Date;
1011

@@ -64,8 +65,8 @@ public void usingDateFormatToFormatDateFull() {
6465

6566
@Koan
6667
public void usingDateFormatToParseDates() throws ParseException {
67-
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
68-
Date date2 = dateFormat.parse("Sat Sep 01 12:34:46 CET 2001");
68+
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy");
69+
Date date2 = dateFormat.parse("01-01-2000");
6970
assertEquals(date2.toString(), __);
7071
// What happened to the time? What do you need to change to keep the time as well?
7172
}

0 commit comments

Comments
 (0)