Class ZonedDateTimeBuilder


  • public class ZonedDateTimeBuilder
    extends Object
    This is basically a Calendar.Builder replacement that builds Java 8 ZonedDateTime instances.
    Author:
    Seth
    • Constructor Detail

      • ZonedDateTimeBuilder

        public ZonedDateTimeBuilder()
    • Method Detail

      • parseZoneId

        public static java.time.ZoneId parseZoneId​(String value)
        Convert a time zone String into a ZoneId. This will work with all standard ZoneId types, plus a mostly-exhaustive list of 3-letter offset abbreviations.
      • getYear

        public Integer getYear()
      • setYear

        public void setYear​(Integer year)
      • getMonth

        public Integer getMonth()
      • setMonth

        public void setMonth​(Integer month)
      • getDayOfMonth

        public Integer getDayOfMonth()
      • setDayOfMonth

        public void setDayOfMonth​(Integer dayOfMonth)
      • getHourOfDay

        public Integer getHourOfDay()
      • setHourOfDay

        public void setHourOfDay​(Integer hourOfDay)
      • getMinute

        public Integer getMinute()
      • setMinute

        public void setMinute​(Integer minute)
      • getSecond

        public Integer getSecond()
      • setSecond

        public void setSecond​(Integer second)
      • getNanosecond

        public Integer getNanosecond()
      • setNanosecond

        public void setNanosecond​(Integer nanosecond)
      • getZoneId

        public java.time.ZoneId getZoneId()
      • setZoneId

        public void setZoneId​(java.time.ZoneId timeZone)
      • build

        public java.time.ZonedDateTime build()
        Build the ZonedDateTime instance. The following fields are required to generate a datestamp:
        • month
        • dayOfMonth

        If missing:

        • year will be assumed to be within the last 12 months or slightly in the future (if the current month is December)
        • hourOfDay, minute, second and nanosecond will be assumed to be zero
        • time zone will be assumed to be the system time zone (ZoneId.systemDefault())
        Returns:
      • getBestZoneId

        protected java.time.ZoneId getBestZoneId()
        Return the specified ZoneId or ZoneId.systemDefault() if none has been specified.
        Returns: