Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created November 10, 2013 22:51
Show Gist options
  • Save marti1125/7405008 to your computer and use it in GitHub Desktop.
Save marti1125/7405008 to your computer and use it in GitHub Desktop.
get first day and last day of month using jodatime
DateTimeFormatter formatterFecha = DateTimeFormat.forPattern("dd/MM/yyyy");
DateTime primerDiaDelMes = new DateTime().dayOfMonth().withMinimumValue();
String desde = new LocalDate(primerDiaDelMes).toString(formatterFecha);
DateTime ultimoDiaDelMes = new DateTime().dayOfMonth().withMaximumValue();
String hasta = new LocalDate(ultimoDiaDelMes).toString(formatterFecha);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment