Clock tickMinutes(ZoneId zone) example

Description

Clock tickMinutes(ZoneId zone) returns a clock for the current instant ticking in whole minutes.

Syntax

tickMinutes has the following syntax.


public static Clock tickMinutes(ZoneId zone)

Example

The following example shows how to use tickMinutes.


import java.time.Clock;
import java.time.ZoneId;
//from  ww w  . j  ava  2s  . c  o m
public class Main {
  public static void main(String[] args) {
    Clock clock = Clock.tickMinutes(ZoneId.systemDefault());
    System.out.println(clock);
    System.out.println(clock.instant());
  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset