Skip to content

Instantly share code, notes, and snippets.

@pete911
Created August 15, 2012 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pete911/3359550 to your computer and use it in GitHub Desktop.
Save pete911/3359550 to your computer and use it in GitHub Desktop.
returns date object with time set to 0
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment