Skip to content

Instantly share code, notes, and snippets.

@edgarMejia
Last active May 6, 2019 14:36
Show Gist options
  • Save edgarMejia/ef6c0c3c5c0301e6bdea1cbf94ecd570 to your computer and use it in GitHub Desktop.
Save edgarMejia/ef6c0c3c5c0301e6bdea1cbf94ecd570 to your computer and use it in GitHub Desktop.
// Convertir un número negativo en positivo. // = 1
Math.abs(-1);
// revisar que un objeto no sea nulo cuando es pasado como paramétro
Long days = getDateDiff(Objects.requireNonNull(Time.parseStringToDate(date)), today);
// Obtener el int de un mes a partir de una fecha.
java.util.Date date= new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(date);
int month = cal.get(Calendar.MONTH);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment