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


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

package com.codingdict;

import java.time.OffsetTime;
import java.time.temporal.ChronoUnit;

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

      OffsetTime date = OffsetTime.now();
      System.out.println(date.truncatedTo(ChronoUnit.HOURS));  
   }
}