Java Date Time Java Java API
java.time.OffsetTime
public int getSecond()
Returns the second-of-minute field from this OffsetTime instance.
package com.logicbig.example.offsettime;import java.time.OffsetTime;import java.time.ZoneOffset;public class GetSecondExample { public static void main(String... args) { OffsetTime d = OffsetTime.of(17, 40, 33, 20000, ZoneOffset.ofHours(-6)); System.out.println(d); int second = d.getSecond(); System.out.println(second); }}
17:40:33.000020-06:0033