
how do i store the system time in a variable in BlueJ ???????

Hi Friend,
Here is your required code:
import java.util.*;
import java.text.*;
class StoreSystemTime {
public static void main(String[] args){
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long time = System.currentTimeMillis();
Date date = new Date(time);
String datestring = dateFormat.format(date);
System.out.println(datestring);
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.