java时间转换,把秒转换为小时,分钟

2021-11-08 00:00:00 转换为 转换 小时

import java.util.Scanner;

public class Timechange {

public static void main(String[] args)

{

Scanner input = new Scanner(System.in);

int hour,minute,second;

second = input.nextInt();

hour = second/3600;

minute = (second – hour*3600)/60;

second = second-hour*300-minute*60;

System.out.println(” hour is “+hour+” minute is “+minute+” second is “+second);

}

}

    原文作者:洋葱ycy
    原文地址: https://blog.csdn.net/ycy0706/article/details/44423065
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。

相关文章