1. How can I get the current time in epoch?
long milliseconds = System.currentTimeMillis();
2. How will I truncate the second part of epoch time?
long milliseconds = System.currentTimeMillis();
System.out.println(new Date(milliseconds - (milliseconds%(1000*60))));
long milliseconds = System.currentTimeMillis();
2. How will I truncate the second part of epoch time?
long milliseconds = System.currentTimeMillis();
System.out.println(new Date(milliseconds - (milliseconds%(1000*60))));
No comments:
Post a Comment