How to get current date in java?

 

 Code:

The following code displays date time in default format:


To get date in desired format, we can use SimpleDateFormat class in Java as follows:

Output:




Comments

Popular posts from this blog

Jenkins CICD in One Page

Why do we need a build tool?

Deutsche Bank Interview Questions - 2024