Hi,
Pretty much same as title.
Here's my DTO :
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
public class BookmarkDto {
private int userId;
private int puzzleId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss.SSS")
private Date createdAt;
Here's my controller
@PostMapping("bookmark")
public ResponseEntity<String> bookmark(@RequestBody BookmarkDto bookmarkDto) {
try {
System.out.println(bookmarkDto);
...
...
Here's the json which I am sending in request body
{
"userId" : 4,
"puzzleId" : 15,
"createdAt" : "2020-02-25 09:55:10.000"
}
But for some reason my date is getting converted to "2020-02-25 15:25:10.000000", the time part is wrong.
I am saving this in a db and am attaching my sysout and db data as images.
Can anyone tell me why this is happening and any way to fix it ?