Java Date Time - LocalTime ofSecondOfDay(long secondOfDay) example








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;

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.