Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how can I support more than 24hours of time format

I have a requirement to support more than 24 hours of time format, for example if the time is 25:15:00 then it should return 01:15:00, in java local Time API. I am unable to find solution for this can someone please help me in this.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use DateTimeFormatter.withResolverStyle(ResolverStyle.LENIENT) to git the expected behavier.

DateTimeFormatter.ofPattern("HH:mm").withResolverStyle(ResolverStyle.LENIENT).parse("25:15")

For more information see the javadoc

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading