FasterXML / jackson-annotations

Core annotations (annotations that only depend on jackson-core) for Jackson data processor
https://github.com/FasterXML/jackson
Apache License 2.0
1.03k stars 330 forks source link

JsonFormat date not working #71

Closed marccollin closed 8 years ago

marccollin commented 9 years ago

I use spring-boot, spring-rest, spring-jpa-data. In my database (mysql), i have date field.

example: 2015-09-29.

I would like to display like with this format: "dd/MM/yyyy".

In my DTO, i do

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd/MM/yyyy", timezone="EST")
private Date birthdate;

on web side, i receive 2015-09-29 not 09/29/2015

cowtowncoder commented 9 years ago

I would need a stand-alone unit test for this, not including Spring components. Also, which Jackson version is this with?

marccollin commented 9 years ago

2.5.4

cowtowncoder commented 9 years ago

2.5 should have support for format patterns for java.util.Date, so that should be ok. But I can not reproduce issue without a unit test.

cowtowncoder commented 8 years ago

Can not reproduce. But if this can be demonstrated with a unit test, should be reported against jackson-databind, as annotations project only defines annotation types but does not implement handling.