Skip to content

Commit 8837a12

Browse files
committed
Fixed SimpleDateFormatUnitTest
1 parent f83798f commit 8837a12

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.baeldung;
1+
package com.baeldung.simpledateformat;
22

33
import org.junit.Test;
44

@@ -32,6 +32,7 @@ public void givenSpecificDate_whenFormattedUsingDateFormat_thenCheckFormatCorrec
3232
@Test
3333
public void givenStringDate_whenParsed_thenCheckDateCorrect() throws Exception{
3434
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
35+
formatter.setTimeZone(TimeZone.getTimeZone("Europe/London"));
3536
Date myDate = new Date(233276400000L);
3637
Date parsedDate = formatter.parse("24-05-1977");
3738
assertEquals(myDate.getTime(), parsedDate.getTime());

0 commit comments

Comments
 (0)