Is there way to initialize dynamic timezone while json output for all date formatted values, I have location id input by which I determine the timezone so each output has the location id so can I use this here as below.
@Configuration
public class TimeZoneConfig {
@Value("${ovitag.timezone}")
private String timezone;
@Bean
public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() {
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getTimeZone("Asia/Kolkata"));
}
}
The above code only change to a particular timezone is it possible here to call the json response here and get that locationId and transform the timezone values dynamically
Json response
{
"VisitDate": "1991-02-19 12:23:56",
"firstName": "dharnisha",
"lastName": "K",
"mainIdentifier": "uhidd90011",
"mobileNumber": "9300921111",
"packageId": "2020"
"locationId":"1234"
}
Timezone is dynamic based on loc id as obtained from below
String timZone = configFileDao.getConfigTimezoneByLocationId(locationId);