to() Methods
Description
toXXX()
converts an object to a related type.
Example
The following code shows some examples of using toXXX() methods.
import java.time.LocalDate;
//from w w w . j a v a2s . co m
public class Main {
public static void main(String[] args) {
LocalDate localDate = LocalDate.of(2014, 6, 21);
long days = localDate.toEpochDay();
System.out.println(days);
}
}
The code above generates the following result.