public class DateService
extends java.lang.Object
| Constructor | Description |
|---|---|
DateService() |
| Modifier and Type | Method | Description |
|---|---|---|
int |
getAge(java.time.LocalDateTime birthDate) |
Calculate the age.
|
double |
getPercentageBetweenDates(java.time.LocalDateTime start,
java.time.LocalDateTime end) |
Calculate the percentage of days passed between the start and end date.
|
boolean |
isPast(java.time.LocalDateTime date) |
Check if a date lies in the past.
|
boolean |
isSameDay(java.time.LocalDateTime date1,
java.time.LocalDateTime date2) |
Check if two dates represent the same day
|
boolean |
isToday(java.time.LocalDateTime date) |
Check if the date is today.
|
public boolean isSameDay(java.time.LocalDateTime date1,
java.time.LocalDateTime date2)
date1 - first date to compairdate2 - second date to compairpublic boolean isToday(java.time.LocalDateTime date)
date - to chack against the current datedate is on the same day as current datepublic boolean isPast(java.time.LocalDateTime date)
date - to be checked.public int getAge(java.time.LocalDateTime birthDate)
birthDate - from which to calculate the agepublic double getPercentageBetweenDates(java.time.LocalDateTime start,
java.time.LocalDateTime end)
start - dateend - dateCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.