java.lang.Object
appointmentplanner.api.LocalDay
Utility class to do zoned time conversion.
- Author:
- Pieter van den Hombergh
p.vandenhombergh@fontys.nl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionat
(int hm, int m) Get the instant at the given hours and minutes.dateOfInstant
(Instant instant) Get the LocalDate of an instant according to this timezone.boolean
getDate()
Get the date.getZone()
Get the timezone identifier.int
hashCode()
static LocalDay
now()
Return the LocalDay for the default time zone at the current date.ofLocalTime
(LocalTime localTime) Get the time as instant.plusDays
(int days) Add x numbers of days to this LocalDay.timeOfInstant
(Instant instant) Get the LocalTime of an instant according to this day.toString()
-
Constructor Details
-
LocalDay
Create a local day in the given timezone at the given date.- Parameters:
zone
- the timezone to usedate
- the LocalDate to use
-
LocalDay
public LocalDay()Create a LocalDay based on the system default timezone and the current date.
-
-
Method Details
-
getDate
Get the date.- Returns:
- the date
-
getZone
Get the timezone identifier.- Returns:
- timezone identifier
-
ofLocalTime
Get the time as instant.- Parameters:
localTime
- the local time- Returns:
- the time as an instant at this date and timezone
-
timeOfInstant
Get the LocalTime of an instant according to this day.- Parameters:
instant
- to convert to LocalTime- Returns:
- the LocalTime of the given instant
-
dateOfInstant
Get the LocalDate of an instant according to this timezone.- Parameters:
instant
- to convert to LocalDate- Returns:
- the LocalDate of the given instant
-
plusDays
Add x numbers of days to this LocalDay.- Parameters:
days
- to add- Returns:
- the new LocalDay shifted forward or backward in time.
-
at
Get the instant at the given hours and minutes.- Parameters:
hm
- the hoursm
- the minutes- Returns:
- Instant at the given ours and minutes
-
now
Return the LocalDay for the default time zone at the current date.- Returns:
- the day
-
toString
-
hashCode
public int hashCode() -
equals
-