Close

Parse string to LocalDateTime

[Updated: Dec 8, 2016, Created: Feb 18, 2016]

Java Java Date Time 

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Test {
public static void main (String[] args) {
String str = "30/Nov/2015:07:00:46 -0700";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MMM/yyyy:HH:mm:ss Z");
LocalDateTime localDateTime = LocalDateTime.parse(str, formatter);
System.out.println(localDateTime);
}
}

See Also