java how to get current time
import java.util.Calendar;
Date currentTime = Calendar.getInstance().getTime();
java how to get current time
import java.util.Calendar;
Date currentTime = Calendar.getInstance().getTime();
How to get current date and time in java
// how to get current date and time in java
// using Date class and System.currentTimeMillis() method
import java.util.Date;
public class UsingDateClass
{
public static void main(String[] args)
{
Date dt = new Date();
System.out.println(dt);
long milliSeconds = System.currentTimeMillis();
Date date = new Date(milliSeconds);
System.out.println(date);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us