获取当前时间

xiaoxiao2021-02-28  5

import java.util.Calendar; public class Time { public static void main(String[] args) { Calendar calendar = Calendar.getInstance(); int hh = calendar.get(Calendar.HOUR); int mm = calendar.get(Calendar.MINUTE); int ss = calendar.get(Calendar.SECOND); System.out.println(hh + ":" + mm + ":" + ss); } }
转载请注明原文地址: https://www.6miu.com/read-2300273.html

最新回复(0)