Here you can find the source of convertTimeToHour(long time)
public static double convertTimeToHour(long time)
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; public class Main { public static double convertTimeToHour(long time) { return convertTimeToDay(time) * 24; }/*from www. j a v a2 s . c om*/ public static double convertTimeToDay(Long timestamp) { java.sql.Timestamp tiempoint = new java.sql.Timestamp(timestamp); LocalDateTime ldt = tiempoint.toLocalDateTime(); double res = ((double) ldt.getHour()) / 24 + ((double) ldt.getMinute()) / (24 * 60) + ((double) ldt.getSecond()) / (24 * 60 * 60); return res; } }