Get Current Date and Time in Java

In this post we will see that how to get current date and time in java using the class java.util.Date and java.text.SimpleDateFormat. Below is the code to get current date and time in java using Date class :- import java.text.SimpleDateFormat; import java.util.Date; public class CurrentDate { public static void main(String[] args) { Date dt = … Read more