LocalTime ofSecondOfDay(long secondOfDay) example

Description

LocalTime ofSecondOfDay(long secondOfDay) gets an instance of LocalTime from a second-of-day value.

Syntax

ofSecondOfDay has the following syntax.


public static LocalTime ofSecondOfDay(long secondOfDay)

Example

The following example shows how to use ofSecondOfDay.


import java.time.LocalTime;
//from   ww w. j a v  a 2  s . c  om
public class Main {
  public static void main(String[] args) {
    LocalTime l = LocalTime.ofSecondOfDay(10000);
    
    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