java.time.Clock.tickSeconds() 方法示例


java.time.Clock.tickSeconds() 方法示例

package com.codingdict;

import java.time.Clock;
import java.time.ZoneId;

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

      Clock clock = Clock.systemDefaultZone();
      Clock clock1 = Clock.tickSeconds(ZoneId.systemDefault());
      System.out.println("Clock : " + clock.instant());
      System.out.println("Clock1 : " + clock1.instant());
   }
}