It's good to be back and posting again. Let me be as straightforward as I can with following Question:
How can I get the Milliseconds of the current System Time and capture it in a variable?
I'm attempting the following:
The preceding code Prints 14 every time, and first of all, I'd like to know Why?. I'm expecting it to print a different number every time (supposedly a 4 digit number). A number that represents the milliseconds within the second. How can I accomplish that?
Calendar.MILLISECOND is a constant you can use to retrieve the number of milliseconds:
This isn't necessary however, and your code contains a lot of code that can be removed.
1) Calendar has a method called getTimeInMillis(). Guess what that does 2) Calendar.getInstance() already returns a Calendar object for the current moment in time. No need to use a new Date object to set the time again. 3) you can already retrieve the number of milliseconds from a Date object using its getTime() method 4) System.currentTimeMillis()!
In fact, that last one is in fact used by all the others as well.