Set Jackson Timezone for Date deserialization

In Jackson 2+, you can also use the @JsonFormat annotation:

@JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone="America/Phoenix")
private Date date;

If it doesn’t work this way then try wrapping Z with single quotes, i.e. pattern=”yyyy-MM-dd’T’HH:mm:ss.SSS’Z'”

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)