Java tutorial
import java.time.Duration; import java.time.Period; public class Main { public static void main(String[] args) { System.out.println(Period.parse("P3Y6M4D")); System.out.println(Duration.parse("PT12H30M5S")); } }