How can I format the "2010-07-14 09:00:02" date string to depict just "9:00"?
How can I format the 2010-07-14 09:00:02 date string to depict just 9:00 ?
Share
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.
Use
DateTimeFormatterto convert between a date string and a realLocalDateTimeobject. with aLocalDateTimeas starting point, you can easily apply formatting based on various patterns as definied in the javadoc of theDateTimeFormatter.In case you’re not on Java 8 or newer yet, use
SimpleDateFormatto convert between a date string and a realDateobject. with aDateas starting point, you can easily apply formatting based on various patterns as definied in the javadoc of theSimpleDateFormat.