Date now = new Date();long time = now.getTime();I have my timestamp in the variable time. But everytime I use time it gives my a different timestamp. How can I take the timestamp when the program starts and store it in a variable?
> Date now = new Date();>long time = now.getTime();> have my timestamp in the variable time. But everytime> I use time it gives my a different timestamp.eh? No it does not.You are doing new Date each time. Stop doing that.