LocalTime of(int hour, int minute) example

Description

LocalTime of(int hour, int minute) gets an instance of LocalTime from an hour and minute.

Syntax

of has the following syntax.


public static LocalTime of(int hour,   int minute)

Example

The following example shows how to use of.


import java.time.LocalTime;
/*from   ww w .  java2  s.  c om*/
public class Main {
  public static void main(String[] args) {
    LocalTime l = LocalTime.of(12,23);

    System.out.println(l);
  }
}

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