Advertisement
Anzak

Date with time reset

Oct 4th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.23 KB | None | 0 0
  1.     static final long day = 1000 * 60 * 60 * 24;
  2.    
  3.     Date date = new Date();
  4.     long current = date.getTime();
  5.     current = current - (current % day) - TimeZone.getDefault().getRawOffset();
  6.     System.out.println(new Date(current));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement