Em chào mọi người
Cho em hỏi là trong Spring boot có cách nào hỗ trợ converter kiểu dữ liệu Date/ TimeStamp sang Number và converter Number về lại kiểu Date/TimeStamp không ạ nếu không mình còn cách nào khác không ạ.
Em cảm ơn
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Spring thì anh thấy không có, tuy nhiên java có hỗ trợ sẵn đó em ạ, em có thể viết các hàm static thế này:
Em co thể tham khảo thêm tại lớp EzyDates này nhé.
Vâng anh em đã chuyển đổi được 2 chiều r ạ em cảm ơn
Có thể em hiểu nhầm, vì Datetime hay Timestamp nếu em dùng epoch time là em quy về kiểu Long, không phải Int nhé, chú ý bộ nhớ 2 cấu trúc dữ liệu này hoàn toàn khác nhau, Int chỉ có 8 bit nhưng Long sẽ nhiều hơn https://www.epochconverter.com/
Đúng ý của em không.
Đúng r anh ạ, em hiểu nhầm khi chuyển đổi phải quy về kiểu Long