Java ZonedDateTime query LocalTime via LocalTime::from

Description

Java ZonedDateTime query LocalTime via LocalTime::from

import java.time.LocalTime;
import java.time.ZonedDateTime;

public class Main {
  public static void main(String[] args) {
    ZonedDateTime zdt = ZonedDateTime.now();

    // Use the LocalTime::from method as a query
    LocalTime lt4 = zdt.query(LocalTime::from);
    System.out.println("lt4: " + lt4);
  }//from w w  w  .j  a  v a 2s .  com
}



PreviousNext

Related