TimeDelta java?

后端 未结 3 1140
孤独总比滥情好
孤独总比滥情好 2021-01-26 08:47

I am trying to convert code from Python to Java. I need to rewrite the timeDelta function in Java. Here is the code in Python:

def timeDate(date):
         


        
3条回答
  •  有刺的猬
    2021-01-26 09:18

    private static LocalTime timeDate(double d) {
        //converts into a local time 
        return LocalTime.ofSecondOfDay((long)(d*3600%86400));   
    }
    

    Input (d):

    36.243356711275794
    

    Output:

    21:22:43
    

提交回复
热议问题