What is the output of the following code?
import java.time.LocalDateTime; import java.time.Period; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; public class Main { public static void main(String[] args) { LocalDateTime d = LocalDateTime.of(2015, 5, 10, 11, 22, 33); Period p = Period.of(1, 2, 3); d = d.minus(p);//from w w w. j a v a 2s.c om DateTimeFormatter f = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT); System.out.println(d.format(f)); } }
E.
Even though d has both date and time, the formatter only outputs time.