You should use HH:mm
.
hh
ranges 01-12
, while HH
ranges 1-23
.
Update
Check the doc of SimpleDateFormat
:
H: Hour in day (0-23)
h: Hour in am/pm (1-12)
More Related Contents:
- How to parse dates in multiple formats using SimpleDateFormat
- SimpleDateFormat producing wrong date time when parsing “YYYY-MM-dd HH:mm”
- SimpleDateFormat parsing date with ‘Z’ literal [duplicate]
- How to convert a String to a Date using SimpleDateFormat?
- Convert String to Calendar Object in Java
- Get yesterday’s date using Date [duplicate]
- Converting String to Date using SimpleDateFormat is returning random date [duplicate]
- Displaying AM and PM in lower case after date formatting
- How to format date string in java? [duplicate]
- Is SimpleDateFormat in Java work incorrect or I did any mistake? See code sample [duplicate]
- Illegal pattern character ‘T’ when parsing a date string to java.util.Date
- Why is Java’s SimpleDateFormat not thread-safe? [duplicate]
- Convert Date/Time for given Timezone – java
- java.text.ParseException: Unparseable date
- Convert java.util.Date to what “java.time” type?
- Number of days in particular month of particular year?
- How to get milliseconds from LocalDateTime in Java 8
- What is the use of “lenient “?
- In Java, how do I get the difference in seconds between 2 dates?
- How can I create a Java 8 LocalDate from a long Epoch time in Milliseconds?
- last day of month calculation
- How to deserialize JS date using Jackson?
- convert epoch time to date
- Android calculate days between two dates
- SimpleDateFormat giving wrong date instead of error
- Java String to DateTime
- How do I get localized date pattern string?
- Does Java 8’s new Java Date Time API take care of DST?
- Simple conversion between java.util.Date and XMLGregorianCalendar
- Best way to get maximum Date value in java?