Doubt:
I know two ways and capturing a TimeInMillis()
does anyone know the difference and which one is the most efficient? What if there is a third way to capture this value?
Option 1:
System.out.println(Calendar.getInstance().getTimeInMillis());
Option 2:
System.out.println(System.currentTimeMillis());
Problem:
I noticed that there is a class called TimeStamp
and I can not pass the System.currentTimeMillis()
to it.
long time = System.currentTimeMillis();
Timestamp timestamp = new Timestamp(time);
Error:
The constructor Timestamp(long) is undefined