java.time.ZonedDateTime.truncatedTo() 方法示例


java.time.ZonedDateTime.truncatedTo() 方法示例

package com.codingdict;

import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;

public class ZonedDateTimeDemo {
   public static void main(String[] args) {

      ZonedDateTime date = ZonedDateTime.now();
      System.out.println(date.truncatedTo(ChronoUnit.DAYS));  
   }
}