Answers for "how to print current data and time in java"

2

How to get current date and time in java

// get current date and time in java using LocalDateTime.now() method
import java.time.LocalDateTime;
public class UsingLocalDateTime
{
   public static void main(String[] args)
   {
      System.out.println(LocalDateTime.now());
   }
}
Posted by: Guest on November-30-2020
2

java how to get current time

import java.util.Calendar;
Date currentTime = Calendar.getInstance().getTime();
Posted by: Guest on November-08-2020

Code answers related to "how to print current data and time in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language