Example usage for java.time LocalTime truncatedTo

List of usage examples for java.time LocalTime truncatedTo

Introduction

In this page you can find the example usage for java.time LocalTime truncatedTo.

Prototype

public LocalTime truncatedTo(TemporalUnit unit) 

Source Link

Document

Returns a copy of this LocalTime with the time truncated.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalTime l = LocalTime.now();
    LocalTime s = l.truncatedTo(ChronoUnit.HOURS);
    System.out.println(s);//from w ww.  j a va 2  s  .c om
}