Merge pull request #5534 from eugenp/Fix-SimpleDateFormatUnitTest

Fixed SimpleDateFormatUnitTest
This commit is contained in:
Eric Martin 2018-10-25 23:53:51 -05:00 committed by GitHub
commit 9289bf858c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,4 @@
package com.baeldung;
package com.baeldung.simpledateformat;
import org.junit.Test;
@ -32,6 +32,7 @@ public class SimpleDateFormatUnitTest {
@Test
public void givenStringDate_whenParsed_thenCheckDateCorrect() throws Exception{
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
formatter.setTimeZone(TimeZone.getTimeZone("Europe/London"));
Date myDate = new Date(233276400000L);
Date parsedDate = formatter.parse("24-05-1977");
assertEquals(myDate.getTime(), parsedDate.getTime());