Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Use libraries in org.isf.utils.time.TimeTools class for convenients methods like

  • public static LocalDateTime getNow() <- to be used in place of standard LocalDateTime.now()

  • public static LocalDateTime getDateToday0()

  • public static LocalDateTime getDateToday24()

  • public static LocalDateTime getBeginningOfDay(LocalDateTime date)

  • public static LocalDateTime getBeginningOfNextDay(LocalDateTime date)

  • public static int getDaysBetweenDates(LocalDateTime from, LocalDateTime to)

  • public static int getWeeksBetweenDates(LocalDateTime from, LocalDateTime to)

  • public static int getMonthsBetweenDates(LocalDateTime from, LocalDateTime to)

  • public static boolean isSameDay(LocalDate aDate, LocalDate today)

  • public static boolean isSameDay(LocalDateTime aDate, LocalDateTime today)

  • etc…

The aim of this class is to standardize the way of managing dates and times within the whole application.

Important: getNow() methods should be used in place of standard LocalDateTime.now() because it forces time precision to SECONDS, regardless the JDK version and OS type (Linux, Windows, Mac they may provide different system clock precisions)

  • No labels