JAVA-23379 Fixed test as per JDK 17 (#14484)
* JAVA-23379 Fixed test as per JDK 17 * JAVA-23379 Made SimpleDateFormat local specific
This commit is contained in:
parent
33a6f4610b
commit
17e24fc87e
|
@ -34,6 +34,7 @@
|
|||
|
||||
<properties>
|
||||
<jackson.version>2.14.2</jackson.version>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -3,6 +3,7 @@ package com.baeldung.jackson.objectmapper;
|
|||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
@ -19,7 +20,7 @@ public class ObjectMapperBuilder {
|
|||
}
|
||||
|
||||
public ObjectMapperBuilder dateFormat() {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm a z");
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm a z", Locale.ENGLISH);
|
||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Asia/Kolkata")));
|
||||
this.dateFormat = simpleDateFormat;
|
||||
return this;
|
||||
|
|
Loading…
Reference in New Issue