Java examples for java.time:LocalTime
convert LocalTime To Relative Time
//package com.java2s; import java.time.*; public class Main { /**//from w w w .java2 s . com * @param time * @return int From Localtime(Hour,Minute,Second) to seconds */ public static int convertToRelativeTime(LocalTime time) { int hour = time.getHour(); int minute = time.getMinute(); int second = time.getSecond(); return hour * 3600 + minute * 60 + second; } }