/
TimeTools (coding dates and time)

TimeTools (coding dates and time)

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)

Related content

Smart Commits (track your time)
Smart Commits (track your time)
More like this
Contribution Guidelines
Contribution Guidelines
Read with this
UI - Translations
UI - Translations
More like this
Jira Issues Workflow (go with the flow)
Jira Issues Workflow (go with the flow)
Read with this
2024-01-18 Call 19 Working Group
2024-01-18 Call 19 Working Group
More like this
Maven or Gradle?
Maven or Gradle?
More like this

Open Hospital powered by ISF
ISF © Informatici Senza Frontiere - ONLUS