0

I am using following to get HH:MM format for time in my pojo:

    @DateTimeFormat(pattern = HTConstants.TIME_FORMAT)
    private LocalTime checkOutTime;

But it returns HH:MM:SS. Any other ways to do this or what am I doing wrong?

3
  • 2
    Did you try pattern="HH:mm"? Make sure you use lower case mm, not MM. Commented Jun 29, 2022 at 8:07
  • Just did, I tried hh:mm and HH:mm both same value is returned. Commented Jun 29, 2022 at 13:33
  • OK, then the problem is not in the code that you've shown. Can you show the code where you're returning it, or showing it as a String? Commented Jun 29, 2022 at 19:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.