What is the output of the following code?
public class Main{ public static void main(String[] argv){ LocalDateTime d = LocalDateTime.of(2015, 5, 10, 22, 33, 44); Period p = Period.of(1, 2, 3); d = d.minus(p); DateTimeFormatter f = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT); System.out.println(d.format(f)); } }
E.
The formatter only outputs time.
//from www .j a v a 2 s.com public class Main{ public static void main(String[] argv){ LocalDateTime d = LocalDateTime.of(2015, 5, 10, 22, 33, 44); Period p = Period.of(1, 2, 3); d = d.minus(p); DateTimeFormatter f = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT); System.out.println(d.format(f)); } }
The code above generates the following result.