Get the App
SLTechnology News&Howtos  ›  Development  › 

How to get the current time in Java8

Shulou Source: shulou.com Published: 2022-06-01 02:14:14 09月21日 Update

This article mainly shows you "how to get the current time in Java8". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "how to get the current time in Java8".

Get 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 ("get the current time without date:" + time);}}

You can see that the current time contains only time information and no date.

The above is all the contents of the article "how to get the current time in Java8". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Time content article date study help information easy to understand more organization knowledge editing industry information information channels channels research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Xiaomi NVidia Redmi MariaDB