Getting the current time in Java 8
package com.shxt.demo02; import java.time.LocalTime; public class Demo06 { public static void main(String[] args) { LocalTime time = LocalTime.now(); System.out.println("获取当前的时间,不含有日期:"+time); } }
You can see that the current time only contains time information and no date
The above is the detailed content of How to get the current time in Java8. For more information, please follow other related articles on the PHP Chinese website!