I am trying to parse a string of format
Thu Apr 07 11:45:28 AEST 2016
into date object. My code looks like following:
Simpl
Using the java.time framework (JSR 310), you can do:
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("EEE MMM d HH:mm:ss zzz yyyy");
ZonedDateTime zdt = ZonedDateTime.parse("Sat Feb 01 15:00:19 AEDT 2014", dtf);
System.out.println(zdt);
…which prints:
2014-02-01T15:00:19+11:00[Australia/Sydney]
Though why it picks Sydney instead of Melbourne I am not sure.