In Java, how can I print out the time since the epoch given in seconds and nanoseconds in the following format :
java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
My input is:
long mnSeconds;
long mnNanoseconds;
Where the total of the two is the elapsed time since the epoch 1970-01-01 00:00:00.0
.
Use this and divide by 1000
long epoch = System.currentTimeMillis();
System.out.println("Epoch : " + (epoch / 1000));