private static String formatUTCDateAsLocalDateTime ( Date javaDate ) { // Now back from start of day in UTC to LocalDateTime to express that we don't know the // timezone. LocalDateTime localDateTime = javaDate . toInstant ( ) . atZone ( UTC ) . toLocalDateTime ( ) ; // And format to string return localDateTime . toString ( ) ; }
Formats parsed Date as LocalDateTime string at zone UTC to express that we don t know the timezone .