Example usage for java.time OffsetDateTime truncatedTo

List of usage examples for java.time OffsetDateTime truncatedTo

Introduction

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

Prototype

public OffsetDateTime truncatedTo(TemporalUnit unit) 

Source Link

Document

Returns a copy of this OffsetDateTime with the time truncated.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.truncatedTo(ChronoUnit.DAYS);
    System.out.println(d);/* w w w  .  ja  v a  2  s . c o m*/
}