I have a String “26/09/2012 07:30:00” is it possible to create a new DateTime based on this String? Eventually i just want the time eg 7:30. I am going to format the DateTime by using DateFormatter eg
DateTimeFormatter fmt = DateTimeFormat.forPattern("k,m");
My question is how to construct a DT from the orginal String, i can format it once it’s a DT.
Create an appropriate
DateTimeFormatterfor the input format, and then callDateTimeFormatter.parseLocalDateTime. (LocalDateTimeis more appropriate thanDateTimehere, as your input data doesn’t have a time zone or UTC offset indicator. You can convert toDateTimeif you really need to, but it sound like you don’t.)