get Hour from java.sql.Time - Java java.sql

Java examples for java.sql:Time

Description

get Hour from java.sql.Time

Demo Code


//package com.java2s;
import java.sql.Time;

import java.time.LocalTime;

public class Main {
    public static int getHour(Time time) {
        LocalTime localTime = time.toLocalTime();

        return localTime.getHour();
    }//from  w w w.  ja  va 2 s  .co  m
}

Related Tutorials